void PlayerCamera::ForceThirdPersonSmooth(void) { if (cameraState == nullptr || cameraState->stateId < kCameraState_ThirdPerson2) { ThirdPersonState* tps = (ThirdPersonState*)cameraStates[kCameraState_ThirdPerson2]; tps->basePosX = tps->fOverShoulderPosX; tps->basePosY = tps->fOverShoulderCombatAddY; tps->basePosZ = tps->fOverShoulderPosZ; tps->curPosY = -0.2f; tps->dstPosY = tps->unk64; SetCameraState(tps); } }
void CEntityMng::ProcessCameraPath( worldentity_t *entity ) { activator_t *activator; worldentity_t *startEnt , *nextEnt; float currRate , diffTime; if( entity->classType != GTH_WORLD_ENTITY_TYPE_CAMERA_PATH ) return; activator = entity->activator; startEnt = (worldentity_t *) activator->currEntity; if( activator->playType & GTH_ENTITY_PLAY_FORWARD ) nextEnt = startEnt->targetEntity; else nextEnt = startEnt->prevEntity; if( !nextEnt || ( startEnt == activator->destEntity ) ) { SetCameraState( activator , startEnt , NULL , 0.0f ); Deactivate( entity ); m_currCameraPathEntity = NULL; return; } diffTime = m_timer->GetAppTime() - activator->currChainTime; if( diffTime < activator->currChainCompleteTime ) { if( activator->currChainCompleteTime > 0.0f ) currRate = diffTime / activator->currChainCompleteTime; else currRate = 0.0f; } else { GTH_LINK_NEXT_CAMERA_PATH_CHAIN : diffTime -= activator->currChainCompleteTime; startEnt = nextEnt; if( !LinkCameraPathChain( startEnt , activator ) ) { SetCameraState( activator , startEnt , NULL , 0.0f ); Deactivate( entity ); m_currCameraPathEntity = NULL; return; } if( diffTime >= activator->currChainCompleteTime ) goto GTH_LINK_NEXT_CAMERA_PATH_CHAIN; if( activator->playType & GTH_ENTITY_PLAY_FORWARD ) nextEnt = startEnt->targetEntity; else nextEnt = startEnt->prevEntity; if( activator->currChainCompleteTime > 0.0f ) currRate = diffTime / activator->currChainCompleteTime; else currRate = 0.0f; } SetCameraState( activator , startEnt , nextEnt , currRate ); }
void Camera::OnMouseButtom(GLFWwindow* window, int buttom, int action, int mods) { double x, y; glfwGetCursorPos(window, &x, &y); SetCameraState(buttom, action, x, y); }