Lines Matching refs:cam
101 MyCameraObj cam; // for projection member
115 MyCameraObj cam; member
137 static void GetTexProjMtx ( MyTransMtxObj* tmo, MyCameraObj* cam, u8 bitMode );
138 static void SetCamera ( MyCameraObj* cam );
353 sc->cam.cfg = DefaultCamera; in DrawInit()
354 sc->cam.theta = 45; in DrawInit()
355 sc->cam.phi = 25; in DrawInit()
356 sc->cam.distance = 2000.0F; in DrawInit()
360 sc->light.cam.theta = 0; in DrawInit()
361 sc->light.cam.phi = 60; in DrawInit()
362 sc->light.cam.distance = 3000.0F; in DrawInit()
433 sc->light.cam.cfg = ( sc->projMode ) ? in DrawTick()
435 SetCamera(&sc->light.cam); in DrawTick()
442 MTXCopy(sc->light.cam.view, tmo.view); in DrawTick()
472 SetCamera(&sc->cam); in DrawTick()
473 SetLight(&sc->light, sc->cam.view); in DrawTick()
494 GetTexProjMtx(&tmo, &sc->light.cam, 0); in DrawTick()
501 GetTexProjMtx(&tmo, &sc->light.cam, 0); in DrawTick()
507 GetTexProjMtx(&tmo, &sc->light.cam, 0); in DrawTick()
513 GetTexProjMtx(&tmo, &sc->light.cam, 1); in DrawTick()
520 GetTexProjMtx(&tmo, &sc->light.cam, 1); in DrawTick()
527 GetTexProjMtx(&tmo, &sc->light.cam, 1); in DrawTick()
533 MTXCopy(sc->cam.view, tmo.view); in DrawTick()
551 sc->cam.theta += ( DEMOPadGetStickX(0) / 24 ); in AnimTick()
552 sc->cam.theta = ( sc->cam.theta + 360 ) % 360; in AnimTick()
553 sc->cam.phi += ( DEMOPadGetStickY(0) / 24 ); in AnimTick()
554 Clamp(sc->cam.phi, 10, 60); in AnimTick()
557 sc->light.cam.theta += ( DEMOPadGetSubStickX(0) / 24 ); in AnimTick()
558 sc->light.cam.theta = ( sc->light.cam.theta + 360 ) % 360; in AnimTick()
559 sc->light.cam.phi += ( DEMOPadGetSubStickY(0) / 24 ); in AnimTick()
560 Clamp(sc->light.cam.phi, 15, 90); in AnimTick()
915 static void SetCamera( MyCameraObj* cam ) in SetCamera() argument
919 r_theta = (f32)cam->theta * PI / 180.0F; in SetCamera()
920 r_phi = (f32)cam->phi * PI / 180.0F; in SetCamera()
922 cam->cfg.location.x = in SetCamera()
923 cam->distance * cosf(r_theta) * cosf(r_phi); in SetCamera()
924 cam->cfg.location.y = in SetCamera()
925 cam->distance * sinf(r_theta) * cosf(r_phi); in SetCamera()
926 cam->cfg.location.z = in SetCamera()
927 cam->distance * sinf(r_phi); in SetCamera()
930 cam->view, in SetCamera()
931 &cam->cfg.location, in SetCamera()
932 &cam->cfg.up, in SetCamera()
933 &cam->cfg.target ); in SetCamera()
935 if ( cam->cfg.type == GX_PERSPECTIVE ) in SetCamera()
938 cam->proj, in SetCamera()
939 cam->cfg.top, in SetCamera()
940 - (cam->cfg.top), in SetCamera()
941 cam->cfg.left, in SetCamera()
942 - (cam->cfg.left), in SetCamera()
943 cam->cfg.znear, in SetCamera()
944 cam->cfg.zfar ); in SetCamera()
949 cam->proj, in SetCamera()
950 cam->cfg.top, in SetCamera()
951 - (cam->cfg.top), in SetCamera()
952 cam->cfg.left, in SetCamera()
953 - (cam->cfg.left), in SetCamera()
954 cam->cfg.znear, in SetCamera()
955 cam->cfg.zfar ); in SetCamera()
958 GXSetProjection(cam->proj, cam->cfg.type); in SetCamera()
975 static void GetTexProjMtx( MyTransMtxObj* tmo, MyCameraObj* cam, u8 bitMode ) in GetTexProjMtx() argument
980 n = cam->cfg.znear; in GetTexProjMtx()
981 f = cam->cfg.zfar; in GetTexProjMtx()
990 if ( cam->cfg.type == GX_PERSPECTIVE ) in GetTexProjMtx()
995 - (cam->cfg.top), // t = -y in projected texture in GetTexProjMtx()
996 cam->cfg.top, in GetTexProjMtx()
997 cam->cfg.left, in GetTexProjMtx()
998 - (cam->cfg.left), in GetTexProjMtx()
999 cam->cfg.znear, in GetTexProjMtx()
1020 - (cam->cfg.top), // t = -y in projected texture in GetTexProjMtx()
1021 cam->cfg.top, in GetTexProjMtx()
1022 cam->cfg.left, in GetTexProjMtx()
1023 - (cam->cfg.left), in GetTexProjMtx()
1040 MTXConcat(proj, cam->view, tmo->texProj); in GetTexProjMtx()
1041 MTXConcat(dp, cam->view, tmo->depth); in GetTexProjMtx()
1056 Vec lpos = light->cam.cfg.location; in SetLight()