//------------------------------------------ // Class methods //------------------------------------------ public CameraTarget() : base() { m_Target = null; m_vLookAtOffset = new Vector3(0, 2.8f, 0); m_vDesiredPositionOffset = new Vector3(0, 2000.0f, 3300.0f); m_vVelocity = Vector3.Zero; }
public bool Init(int ID, Object3D target) { base.Init(ID, ECamType.ECAMERA_TYPE_TARGET, target.GetPosition(), target.GetRotation()); m_Target = target; // Set the camera offsets m_vDesiredPositionOffset = new Vector3(0.0f, 1500.0f, 3500.0f); m_vLookAtOffset = new Vector3(0.0f, 350.0f, 0.0f); return true; }
public int CreateCamera(Camera.ECamType type, bool bActive, Object3D target, Vector3 pos, Vector3 rot) { int iCameraID = ++m_iIDCameraCounter; if (GetCamera(iCameraID) != null) return INVALID_CAMERA_ID; if (type == Camera.ECamType.ECAMERA_TYPE_TARGET) { CameraTarget newCamera = new CameraTarget(); newCamera.Init(iCameraID, target); m_CameraList.Add(newCamera); } else if (type == Camera.ECamType.ECAMERA_TYPE_FREE) { CameraFree newCamera = new CameraFree(); newCamera.Init(iCameraID, pos, rot); m_CameraList.Add(newCamera); } if (bActive) { // we set as active camera by default the first created one m_iActiveCameraID = iCameraID; } return iCameraID; }
public void SetTarget(Object3D target) { m_Target = target; UpdateWorldPositions(); m_vPosition = m_vDesiredPosition; }