My Project
|
Auto Camera is designed to handle smooth transitions between supported camera type, such as first person camera, third person camera, and rotation camera. More...
#include <AutoCamera.h>
Classes | |
struct | CameraConstraint |
Public Types | |
enum | CameraConstraintEnum { CameraConstraintFocus, CameraConstraintNone } |
![]() | |
enum | _SceneObjectType { BaseObject = 0, ContainerObject = 0x1, MeshObject = 0x1<<1, SkyMesh = 0x1<<2, BipedObject = 0x1<<3, SpriteObject = 0x1<<4, SceneRoot = 0x1<<5, OPCBiped = 0x1<<6, RPGBiped = 0x1<<7, MDXObject = 0x1<<8, MeshPhysicsObject = 0x1<<9, DynamicObject = 0x1<<10, ViewCullingObject = 0x1<<11, MissileObject = 0x1<<12, GameObject = 0x1<<13, LightObject = 0x1<<14, MiniSceneGraph = 0x1<<15, VoxelMesh = 0x1<<16, ManagedLoader = 0x1<<17, ZoneNode = 0x1<<18, PortalNode = 0x1<<19, AntiPortalNode = 0x1<<20, CadObject = 0x1<<21 } |
enum | CallBackType { Type_EnterSentientArea =0, Type_LeaveSentientArea, Type_Click, Type_Event, Type_Perception, Type_FrameMove, Type_Net_Send, Type_Net_Receive, Type_OnLoadScript, Type_OnAssetLoaded, Type_Paint, Type_Unknown } |
call back type | |
enum | NPL_STRING { NPL_CREATE = 0, NPL_CREATE_IN_LOADER = 0x1<<1, NPL_UPDATE = 0x1<<2, NPL_DELETE = 0x1<<3, NPL_DONOT_OUTPUT_ASSET = 0x1<<4 } |
by which method an object is converted to NPL string. More... | |
enum | CompressOption { ReleaseDevices = 1, ReleasePhysics = 2, ReleaseEvents = 4 } |
typedef ParaEngine::weak_ptr< IObject, CBaseObject > | WeakPtr_type |
typedef unordered_ref_array< CBaseObject * > | CChildObjectList_Type |
typedef std::list< ObjectEvent > | ObjectEventList_Type |
![]() | |
typedef ParaEngine::weak_ptr< IObject, IAttributeFields > | WeakPtr_type |
![]() | |
typedef ParaEngine::weak_ptr< IObject > | WeakPtr_type |
![]() | |
typedef std::vector< ScriptCallback > | ObjectCallbackPool_Type |
Public Member Functions | |
CAutoCamera (void) | |
virtual int | GetAttributeClassID () |
attribute class ID should be identical, unless one knows how overriding rules work. More... | |
virtual const char * | GetAttributeClassName () |
a static string, describing the attribute class object's name | |
virtual const char * | GetAttributeClassDescription () |
a static string, describing the attribute class object | |
virtual int | InstallFields (CAttributeClass *pClass, bool bOverride) |
this class should be implemented if one wants to add new attribute. More... | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsAlwaysRun_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetAlwaysRun_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsCamAlwaysBehindObject_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetCamAlwaysBehindObject_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsUseRightButtonBipedFacing_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetUseRightButtonBipedFacing_s, bool) | |
ATTRIBUTE_METHOD (CAutoCamera, Reset_s) | |
ATTRIBUTE_METHOD (CAutoCamera, FreeCameraMode_s) | |
ATTRIBUTE_METHOD (CAutoCamera, FollowMode_s) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetCameraMode_s, int *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetCameraMode_s, int) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetKeyboardMovVelocity_s, float *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetKeyboardMovVelocity_s, float) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetKeyboardRotVelocity_s, float *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetKeyboardRotVelocity_s, float) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetCameraObjectDistance_s, double *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetCameraObjectDistance_s, double) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetCameraLiftupAngle_s, double *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetCameraLiftupAngle_s, double) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetCameraRotX_s, double *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetCameraRotX_s, double) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetCameraRotY_s, double *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetCameraRotY_s, double) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetCameraRotZ_s, double *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetCameraRotZ_s, double) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetLookAtShiftY_s, double *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetLookAtShiftY_s, double) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetEnableKeyboard_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, EnableKeyboard_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetEnableMouseLeftButton_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, EnableMouseLeftButton_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetEnableMouseRightButton_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, EnableMouseRightButton_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetEnableMouseWheel_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, EnableMouseWheel_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetPhysicsGroupMask_s, DWORD *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetPhysicsGroupMask_s, DWORD) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsEnableMouseRightDrag_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, EnableMouseRightDrag_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsEnableMouseLeftDrag_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, EnableMouseLeftDrag_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsLockMouseWhenDragging_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetLockMouseWhenDragging_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsUseCharacterLookup_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetUseCharacterLookup_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetAlwaysRotateCameraWhenFPS_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, EnableAlwaysRotateCameraWhenFPS_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsUseCharacterLookupWhenMounted_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetUseCharacterLookupWhenMounted_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetCharacterLookupBoneIndex_s, int *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetCharacterLookupBoneIndex_s, int) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsCameraMoved_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsBlockInput_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetBlockInput_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetMaxCameraObjectDistance_s, double *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetMaxCameraObjectDistance_s, double) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetMinCameraObjectDistance_s, double *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetMinCameraObjectDistance_s, double) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetCameraRollbackSpeed_s, float *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetCameraRollbackSpeed_s, float) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetCameraLookatOffset_s, Vector3 *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetCameraLookatOffset_s, Vector3) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetAdditionalCameraRotate_s, Vector3 *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetAdditionalCameraRotate_s, Vector3) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetMaxYShiftSpeed_s, float *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetMaxYShiftSpeed_s, float) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetMaxAllowedYShift_s, float *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetMaxAllowedYShift_s, float) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsControlBiped_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetControlBiped_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsEnableBlockCollision_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetEnableBlockCollision_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, IsIgnoreEyeBlockCollisionInSunlight_s, bool *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, SetIgnoreEyeBlockCollisionInSunlight_s, bool) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetRenderOrigin_s, Vector3 *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetViewProjMatrix_s, Matrix4 *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetViewMatrix_s, Matrix4 *) | |
ATTRIBUTE_METHOD1 (CAutoCamera, GetProjMatrix_s, Matrix4 *) | |
ATTRIBUTE_METHOD (CAutoCamera, UpdateBipedFlyDir_s) | |
CEventBinding * | GetEventBinding () |
Get the current event binding object. More... | |
void | LoadDefaultEventBinding () |
load the default camera key and mouse event binding. More... | |
virtual VOID | FrameMove (FLOAT fElapsedTime) |
Call these from client and use Get*Matrix() to read new matrices. More... | |
void | UpdateBipedFlyDir (CBipedObject *pBiped=NULL) |
CBipedObject * | GetTargetAsBiped () |
virtual LRESULT | HandleMessages (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
virtual void | SetViewParams (const DVector3 &vEyePt, const DVector3 &vLookatPt) |
void | FollowBiped (CBaseObject *pBiped, CameraMode modeCamera, double dTransitionTime) |
Desc: Get the mouse pay for object picking [in] dTransitionTime: can be 0 or greater than 0 when dTransitionTime is zero, the camera is focuses on the biped from no where if dTransitionTime is greater than 0, the camera will smoothly move to the biped. More... | |
void | FollowBiped (CBaseObject *pBiped, int nTranstionMode, int modeCamera, double Param0, double Param1, double Param2) |
pBiped can be nil, in which case the same biped is followed. More... | |
void | SetCameraMode (CameraMode modeCamera) |
virtual CameraMode | GetCameraMode () |
virtual void | SetFollowTarget (CBaseObject *pObj) |
virtual CBaseObject * | GetFollowTarget () |
bool | SmoothMove (DVector3 *result, DVector3 vPosTarget, DVector3 vPos, float fIncrease, float fTolerance=0) |
linearly (smoothly) move vPos to vPosTarget by the amount fIncrease More... | |
void | UpdateViewProjMatrix () |
Matrix4 * | GetViewProjMatrix () |
void | ComputeViewMatrix (Matrix4 *pOut, const DVector3 *pEye, const DVector3 *pAt, const Vector3 *pUp) |
compute view matrix by coordinate in world space. More... | |
void | UpdateViewMatrix () |
it calls ComputeViewMatrix() with the current eye settings. More... | |
void | HandleUserInput () |
Handle the user input from direct input: update the key state, process key event, process mouse event. More... | |
bool | IsAlwaysRun () |
always running More... | |
void | SetAlwaysRun (bool bAlwaysRun) |
bool | IsCameraMoved () |
whether camera moved since last frame | |
Vector3 | GetRenderOrigin () |
current render origin. More... | |
bool | IsCamAlwaysBehindObject () |
whether camera is locked behind the current character. More... | |
void | SetCamAlwaysBehindObject (bool bIsCamAlwaysBehindObject) |
bool | IsUseCharacterLookup () |
whether the camera look up vector will use the character look up. More... | |
void | SetUseCharacterLookup (bool bUseCharacterLookup) |
whether the camera look up vector will use the character look up. More... | |
bool | IsUseCharacterLookupWhenMounted () |
Default to true. More... | |
void | SetUseCharacterLookupWhenMounted (bool bUseCharacterLookup) |
Default to true. More... | |
int | GetCharacterLookupBoneIndex () |
-1 to disable, otherwise this is the attachment bone id to which we will bind the camera's lookup to. More... | |
void | SetCharacterLookupBoneIndex (int nIndex) |
-1 to disable, otherwise this is the attachment bone id to which we will bind the camera's lookup to. More... | |
bool | IsUseRightButtonBipedFacing () |
when set to true, the right mouse drag will change character facing when biped is standing still. | |
void | SetUseRightButtonBipedFacing (bool bUseRightButtonBipedFacing) |
bool | IsEnableMouseRightDrag () |
whether camera dragging with right button if enabled. More... | |
void | EnableMouseRightDrag (bool bEnabled) |
set whether camera dragging with right button if enabled. More... | |
bool | IsEnableMouseLeftDrag () |
whether camera dragging with left button if enabled. More... | |
void | EnableMouseLeftDrag (bool bEnabled) |
set whether camera dragging with left button if enabled. More... | |
bool | IsLockMouseWhenDragging () const |
whether to lock mouse during dragging, default to false. More... | |
void | SetLockMouseWhenDragging (bool val) |
void | Reset () |
reset camera, without playing transitions. | |
void | FreeCameraMode () |
switch to free camera mode More... | |
void | FollowMode () |
switch to follow mode. | |
float | GetKeyboardMovVelocity () |
void | SetKeyboardMovVelocity (float fValue) |
max speed of movement velocity using keyboard. More... | |
float | GetKeyboardRotVelocity () |
void | SetKeyboardRotVelocity (float fValue) |
max speed of rotational velocity using keyboard. More... | |
void | EnableStereoVision (bool bEnable) |
whether to enable stereo vision. More... | |
bool | IsStereoVisionEnabled () |
void | SetStereoEyeShiftDistance (float fDist) |
this is usually half of the Stereo eye separation distance. More... | |
float | GetStereoEyeShiftDistance () |
void | SetCameraObjectDistance (double fDist) |
the camera object distance after all kinds of constraints are applied. More... | |
double | GetCameraObjectDistance () |
void | SetCameraLiftupAngle (double fValue) |
lift up angle of the camera. More... | |
double | GetCameraLiftupAngle () |
void | SetCameraRotX (double fValue) |
rotation of the camera around the X axis, in the world coordinate. More... | |
double | GetCameraRotX () |
void | SetCameraRotY (double fValue) |
rotation of the camera around the Y axis, in the world coordinate. More... | |
double | GetCameraRotY () |
void | SetCameraRotZ (double fValue) |
rotation of the camera around the Z axis, in the world coordinate. More... | |
double | GetCameraRotZ () |
void | SetLookAtShiftY (double fValue) |
the Y shift of the camera look at position during follow mode. More... | |
double | GetLookAtShiftY () |
void | EnableKeyboard (bool bValue) |
whether handler keyboard message | |
bool | GetEnableKeyboard () |
void | EnableMouseLeftButton (bool bValue) |
whether Enable Mouse Left Button | |
bool | GetEnableMouseLeftButton () |
void | EnableMouseRightButton (bool bValue) |
whether Enable Mouse Right Button | |
bool | GetEnableMouseRightButton () |
void | EnableAlwaysRotateCameraWhenFPS (bool bValue) |
Default to true. More... | |
bool | GetAlwaysRotateCameraWhenFPS () |
void | EnableMouseWheel (bool bValue) |
whether Enable Mouse wheel Button | |
bool | GetEnableMouseWheel () |
void | SetPhysicsGroupMask (DWORD dwValue) |
set groups Mask used to filter physics objects, default to 0xffffffff | |
DWORD | GetPhysicsGroupMask () |
get groups Mask used to filter physics objects, default to 0xffffffff | |
bool | IsBlockInput () |
whether to block all user input (both key and mouse). More... | |
void | SetBlockInput (bool bBlockInput) |
void | SetMaxCameraObjectDistance (double fValue) |
max camera object distance when mouse wheel is used for zooming. More... | |
double | GetMaxCameraObjectDistance () |
void | SetMinCameraObjectDistance (double fValue) |
min camera object distance when mouse wheel is used for zooming. More... | |
double | GetMinCameraObjectDistance () |
void | SetCameraRollbackSpeed (float fValue) |
the camera roll back speed in meters per second. More... | |
float | GetCameraRollbackSpeed () |
void | SetCameraLookatOffset (const Vector3 &v) |
additional camera offset in camera space. More... | |
Vector3 | GetCameraLookatOffset () |
Vector3 | GetAdditionalCameraRotate () const |
additional camera rotation in camera space. More... | |
void | SetAdditionalCameraRotate (const Vector3 &val) |
float | GetMaxAllowedYShift () |
we will smooth the camera movement on the y direction when the followed biped's y movement is smaller than this value. More... | |
void | SetMaxAllowedYShift (float fValue) |
float | GetMaxYShiftSpeed () |
the max speed camera interpolation speed along y axis. More... | |
void | SetMaxYShiftSpeed (float fValue) |
bool | IsFirstPersonView () |
whether first person view mode | |
bool | IsControlBiped () const |
whether the camera is able to control the biped movement. More... | |
void | SetControlBiped (bool val) |
whether the camera is able to control the biped movement. More... | |
virtual int | On_FrameMove (float fElapsedTime) |
called every frame move when this character is sentient. More... | |
bool | IsEnableBlockCollision () const |
enabled by default. More... | |
void | SetEnableBlockCollision (bool val) |
bool | IsIgnoreEyeBlockCollisionInSunlight () const |
enabled by default. More... | |
void | SetIgnoreEyeBlockCollisionInSunlight (bool val) |
virtual Vector3 | GetRenderEyePosition () |
![]() | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetNearPlane_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetNearPlane_s, float) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetFarPlane_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetFarPlane_s, float) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetFieldOfView_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetFieldOfView_s, float) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetAspectRatio_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetAspectRatio_s, float) | |
ATTRIBUTE_METHOD1 (CBaseCamera, IsPerspectiveView_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetIsPerspectiveView_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetOrthoWidth_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetOrthoWidth_s, float) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetOrthoHeight_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetOrthoHeight_s, float) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetMoveScaler_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetMoveScaler_s, float) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetRotationScaler_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetRotationScaler_s, float) | |
ATTRIBUTE_METHOD1 (CBaseCamera, IsShiftMoveSwitched_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetShiftMoveSwitched_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseCamera, IsInvertPitch_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetInvertPitch_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetNumberOfFramesToSmoothMouseData_s, int *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetNumberOfFramesToSmoothMouseData_s, int) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetEyePosition_s, DVector3 *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetLookAtPosition_s, DVector3 *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetMovementDrag_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetMovementDrag_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseCamera, GetTotalDragTime_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseCamera, SetTotalDragTime_s, float) | |
ATTRIBUTE_METHOD (CBaseCamera, FrameMove_s) | |
DEFINE_SCRIPT_EVENT (CBaseCamera, FrameMove) | |
void | UpdateFrustum () |
update the culling planes according to view and projection matrix on top of the global stack More... | |
CCameraFrustum * | GetFrustum () |
get the camera view frustum info | |
CPortalFrustum * | GetPortalFrustum () |
get the camera view frustum info | |
CCameraFrustum * | GetObjectFrustum () |
get the object view frustum info object view frustum is smaller than m_frustum; its far plane is set at fog end | |
CCameraFrustum * | GetShadowFrustum () |
get the shadow view frustum info shadow view frustum is smaller than m_frustum_object; its far plane is set at a fixed size, such as the smaller of 50 and fog end | |
bool | CanSeeObject (IViewClippingObject *pObj) |
test again view frustum More... | |
Plane & | GetFogPlane () |
test to see if any of the vertices are inside the fog plane | |
void | SetProjParams (FLOAT fFOV, FLOAT fAspect, FLOAT fNearPlane, FLOAT fFarPlane) |
void | UpdateProjParams () |
update the projection matrix using the current field of view and near and far plane values. More... | |
void | UpdateProjParams (FLOAT fAspect) |
VOID | SetInvertPitch (bool bInvertPitch) |
bool | IsInvertPitch () |
VOID | SetDrag (bool bMovementDrag, FLOAT fTotalDragTimeToZero=0.25f) |
VOID | SetEnableYAxisMovement (bool bEnableYAxisMovement) |
VOID | SetEnablePositionMovement (bool bEnablePositionMovement) |
VOID | SetClipToBoundary (bool bClipToBoundary, Vector3 *pvMinBoundary, Vector3 *pvMaxBoundary) |
VOID | SetScalers (FLOAT fRotationScaler=0.01f, FLOAT fMoveScaler=5.0f) |
VOID | SetRotationScaler (FLOAT fRotationScaler=0.01f) |
float | GetRotationScaler () |
VOID | SetMoveScaler (FLOAT fMoveScaler=5.0f) |
float | GetMoveScaler () |
VOID | SetNumberOfFramesToSmoothMouseData (int nFrames) |
int | GetNumberOfFramesToSmoothMouseData () |
VOID | SetResetCursorAfterMove (bool bResetCursorAfterMove) |
bool | IsShiftMoveSwitched () |
whether the AD and QE key are switched for character movement. More... | |
void | SetShiftMoveSwitched (bool bSwitched=false) |
whether the AD and QE key are switched for character movement. More... | |
Matrix4 * | GetViewMatrix () |
Matrix4 * | GetProjMatrix () |
bool | IsBeingDragged () |
bool | IsMouseLButtonDown () |
bool | IsMouseMButtonDown () |
bool | IsMouseRButtonDown () |
void | GetMouseRay (Vector3 &vPickRayOrig, Vector3 &vPickRayDir, POINT ptCursor, UINT nWidth, UINT nHeight, const Matrix4 *pMatWorld) |
Desc: Get the mouse pay for object picking [in] fCursor: mouse position [in] nWidth, nHeight: Device Screen size [in] world transform matrix. | |
DVector3 | GetEyePosition () |
DVector3 | GetLookAtPosition () |
float | GetFieldOfView () |
float | GetAspectRatio () |
float | GetNearPlane () |
float | GetFarPlane () |
float | GetOrthoHeight () |
float | GetOrthoWidth () |
bool | IsPerspectiveView () |
get whether we use perspective view or orthogonal view | |
void | SetIsPerspectiveView (bool bIsPerspectiveView) |
set whether we use perspective view or orthogonal view | |
void | SetFieldOfView (float fFieldofview) |
change the field of view . More... | |
void | SetNearPlane (float fDist) |
change the near plane. More... | |
void | SetFarPlane (float fDist) |
change the far plane. More... | |
void | SetAspectRatio (float fAspect) |
change the aspect ratio. More... | |
void | SetOrthoWidth (float fWidth) |
change orthographic width of view volumn. More... | |
void | SetOrthoHeight (float fHeight) |
change orthographic height of view volumn. More... | |
void | CopyCameraParamsFrom (CBaseCamera *pFromCamera) |
copy only basic parameters like projection and camera transforms, etc. More... | |
Vector3 | GetWorldRight () |
Vector3 | GetWorldUp () |
Vector3 | GetWorldAhead () |
Vector3 | GetEyePt () |
![]() | |
ATTRIBUTE_DEFINE_CLASS (CTileObject) | |
virtual bool | IsTileObject () |
if true, we will attach this object to quad-tree terrain tile according to its attributes when adding to the scene if false, we will automatically attach it to a container object named after its class name. | |
virtual DVector3 | GetPosition () |
always bottom center of the bounding shape | |
virtual void | SetPosition (const DVector3 &v) |
always bottom center of the bounding shape | |
virtual void | SetBoundingBox (float fOBB_X, float fOBB_Y, float fOBB_Z, float fFacing) |
Set the object shape to box and bounding box parameters if fFacing is 0, it is a axis aligned bounding box (AABB). More... | |
virtual void | GetBoundingBox (float *fOBB_X, float *fOBB_Y, float *fOBB_Z, float *fFacing) |
virtual void | SetBoundRect (float fWidth, float fHeight, float fFacing) |
Set the object shape to rect (a plane) and rect parameters if fFacing is 0, it is a axis aligned bounding box (AABB). More... | |
virtual void | GetBoundRect (float *fWidth, float *fHeight, float *fFacing) |
virtual void | SetRadius (float fRadius) |
Set the object shape to Sphere and sphere parameters. More... | |
virtual float | GetRadius () |
virtual float | GetYaw () |
get object Yaw: is facing the positive x axis, if yaw is 0. | |
virtual void | SetYaw (float fValue) |
virtual float | GetHeight () |
get object height y axis: only for object that has a Height property, usually is height of the bounding box | |
virtual void | SetHeight (float fHeight) |
virtual float | GetWidth () |
get object width: x axis | |
virtual void | SetWidth (float fWidth) |
virtual float | GetDepth () |
get object depth: z axis | |
virtual void | SetDepth (float fDepth) |
virtual void | SetAABB (const Vector3 *vMin, const Vector3 *vMax) |
Set AABB information. More... | |
virtual Vector3 | GetLocalAABBCenter () |
virtual void | GetOBB (CShapeOBB *obb) |
get the oriented bounding box in world space. More... | |
virtual void | GetAABB (CShapeAABB *aabb) |
virtual DVector3 | GetObjectCenter () |
get the center of the object in world space | |
virtual void | SetObjectCenter (const DVector3 &v) |
set the center of the object in world space | |
virtual void | GetVerticesWithOrigin (const Vector3 *vOrigin, Vector3 *pVertices, int *nNumber) |
![]() | |
virtual CBaseObject::_SceneObjectType | GetType () |
virtual void | Clone (CBaseObject *obj) |
Clone the object's contains to a pointer. More... | |
virtual CBaseObject * | Clone () |
Clone the object's contains and return a pointer to the newly created object. More... | |
virtual std::string | ToString (DWORD nMethod) |
convert the object to an NPL string by which this object may be created or deleted. More... | |
int | GetID () |
the ID of the object. More... | |
virtual bool | AddChildAttributeObject (IAttributeFields *pChild, int nRowIndex=-1, int nColumnIndex=0) |
add child object. More... | |
virtual void * | QueryObjectByName (const std::string &sObjectType) |
convert to object of a given type. More... | |
virtual void * | QueryObject (int nObjectType) |
convert to object of a given type. More... | |
ATTRIBUTE_METHOD1 (CBaseObject, GetID_s, int *) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsGlobal_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetFacing_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetFacing_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetYaw_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetYaw_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetPitch_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetPitch_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetRoll_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetRoll_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetHeight_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetHeight_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetWidth_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetWidth_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetDepth_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetDepth_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetRadius_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetRadius_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetPosition_s, DVector3 *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetPosition_s, DVector3) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetAssetFileName_s, const char **) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetAssetFileName_s, const char *) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetTechHandle_s, int *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetTechHandle_s, int) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetCtorPercentage_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetCtorPercentage_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetHomeZone_s, const char **) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetHomeZone_s, const char *) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetShowBoundingBox_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetShowBoundingBox_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetPhysicsGroup_s, int *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetPhysicsGroup_s, int) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetPhysicsGroupMask_s, DWORD *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetPhysicsGroupMask_s, DWORD) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetSelectGroupIndex_s, int *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetSelectGroupIndex_s, int) | |
ATTRIBUTE_METHOD (CBaseObject, Reset_s) | |
DEFINE_SCRIPT_EVENT_GET (CBaseObject, OnAssetLoaded) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetOnAssetLoaded_s, const char *) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetRenderOrder_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetRenderOrder_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetRenderImportance_s, int *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetRenderImportance_s, int) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetRenderDistance_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetRenderDistance_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetAnimation_s, int *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetAnimation_s, int) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetAnimFrame_s, int *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetAnimFrame_s, int) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsAnimEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, EnableAnim_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsUseGlobalTime_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetUseGlobalTime_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetChildCount_s, int *) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetNormal_s, Vector3 *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetNormal_s, Vector3) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsTransparent_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetTransparent_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsVisible_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetVisibility_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsShadowCaster_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetShadowCaster_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsShadowReceiver_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetShadowReceiver_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsBillboarded_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetBillboarded_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsSkipRender_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetSkipRender_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsSkipPicking_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetSkipPicking_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsSkipTerrainNormal_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetSkipTerrainNormal_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetSelectionEffect_s, int *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetSelectionEffect_s, int) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsHeadOnZEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetHeadOnZEnabled_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsHeadOn3DScalingEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetHeadOn3DScalingEnabled_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsHeadOnUseGlobal3DScaling_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetHeadOnUseGlobal3DScaling_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetHeadOnNearZoomDist_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetHeadOnNearZoomDist_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetHeadOnFarZoomDist_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetHeadOnFarZoomDist_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetHeadOnMinUIScaling_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetHeadOnMinUIScaling_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetHeadOnMaxUIScaling_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetHeadOnMaxUIScaling_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetHeadOnAlphaFadePercentage_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetHeadOnAlphaFadePercentage_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetHeadOn3DFacing_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetHeadOn3DFacing_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsPersistent_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetPersistent_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsDead_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetDead_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsTileObject_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetTileObject_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetFrameNumber_s, int *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetFrameNumber_s, int) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetOpacity_s, float *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetOpacity_s, float) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsLastFrameRendered_s, bool *) | |
ATTRIBUTE_METHOD (CBaseObject, DestroyChildren_s) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetRenderMatrix_s, Matrix4 *) | |
ATTRIBUTE_METHOD1 (CBaseObject, SetLocalTransform_s, const Matrix4 &) | |
ATTRIBUTE_METHOD1 (CBaseObject, GetLocalTransform_s, Matrix4 *) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsPhysicsEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, EnablePhysics_s, bool) | |
ATTRIBUTE_METHOD1 (CBaseObject, IsLODEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CBaseObject, EnableLOD_s, bool) | |
virtual IAttributeFields * | GetChildAttributeObject (const std::string &sName) |
get attribute by child object. More... | |
virtual int | GetChildAttributeObjectCount (int nColumnIndex=0) |
get the number of child objects (row count) in the given column. More... | |
virtual int | GetChildAttributeColumnCount () |
we support multi-dimensional child object. More... | |
virtual IAttributeFields * | GetChildAttributeObject (int nRowIndex, int nColumnIndex=0) |
virtual bool | IsGlobal () |
whether this object is global. More... | |
bool | IsBiped () |
virtual IGameObject * | QueryIGameObject () |
this may return NULL, if the object does not implement the IGameObject interface. More... | |
virtual IAttributeFields * | GetAttributeObject () |
bool | CheckVolumnField (DWORD volType) |
Use CheckAttribute() | |
virtual TextureEntity * | GetTexture () |
bool | CheckAttribute (DWORD attribute) |
whether an object attribute is enabled. More... | |
void | SetAttribute (DWORD dwAtt, bool bTurnOn=true) |
enable or disable a given attribute. More... | |
void | SetBillboarded (bool bBillboarded) |
bool | IsBillboarded () |
if the model asset file name ended with "_b" it will be treated as billboarded. More... | |
void | SetShadowReceiver (bool bEnable) |
bool | IsShadowReceiver () |
if the model asset file name ended with "_r" it will be treated as shadow receiver. More... | |
void | SetShadowCaster (bool bEnable) |
set whether it is shadow caster. More... | |
bool | IsShadowCaster () |
void | SetVegetation (bool bIsVegetation) |
whether to render this mesh using the vegetation shader | |
bool | IsVegetation () |
whether to render this mesh using the vegetation shader | |
void | ShowBoundingBox (bool bShowBoundingBox) |
set whether to show bounding box for this object. | |
bool | IsShowBoundingBox () |
get whether to show bounding box for this object. | |
CZoneNode * | GetHomeZone () |
get the home zone of this object if any. More... | |
void | SetHomeZone (CZoneNode *pZone) |
set the home zone of this object if any. More... | |
bool | IsVisible () |
invisible object will not be drawn. More... | |
void | SetVisibility (bool bVisible) |
set the visibility of this object. More... | |
bool | IsRenderable () |
whether this object can be rendered. More... | |
void | SetSkipRender (bool bSkipRender) |
set whether object should be excluded from the skip render | |
bool | IsSkipRender () |
get whether object should be excluded from the render queue. More... | |
void | SetSkipPicking (bool bSkipPicking) |
set whether object should be excluded from picking | |
bool | IsSkipPicking () |
get whether object should be excluded from picking. More... | |
void | SetSkipTerrainNormal (bool bSkip) |
if specified, this character will always be perpendicular to the ground, regardless to the terrain normal. More... | |
bool | IsSkipTerrainNormal () |
if specified, this character will always be perpendicular to the ground, regardless to the terrain normal. More... | |
bool | CanPick () |
get whether object can be picked by mouse picking. More... | |
virtual bool | CanHasPhysics () |
if the object may contain physics | |
virtual void | LoadPhysics () |
load the physics objects. | |
virtual void | UnloadPhysics () |
load the physics object | |
virtual void | EnablePhysics (bool bEnable) |
this function will turn on or off the physics of the object. More... | |
virtual void | SetAlwaysLoadPhysics (bool bEnable) |
by default physics is lazy-load when player walk into its bounding box, setting this to false will always load the physics. More... | |
virtual bool | IsPhysicsEnabled () |
virtual bool | ViewTouch () |
this function is called, when the object is in view range. More... | |
void | SetRenderImportance (int nRenderImportance) |
the larger, the more important. More... | |
int | GetRenderImportance () |
float | GetRenderOrder () const |
0 if automatic, larger number renders after smaller numbered object. More... | |
void | SetRenderOrder (float val) |
CChildObjectList_Type & | GetChildren () |
– Base object functions | |
CBaseObject * | GetChildByName (const string &name, bool bRecursive=false) |
get child by name: it may return NULL if the child does not exist. More... | |
virtual void | DestroyChildren () |
Completely destroy child nodes from memory recursively. More... | |
int | DestroyChildByName (const string &name, bool bRecursive=false) |
destroy a child by name. More... | |
int | RemoveChildByName (const string &name, bool bRecursive=false) |
remove a child by name but it does not destroy it. More... | |
int | RemoveChild (const CBaseObject *pObj, bool bRecursive=false) |
remove a child by pointer but it does not destroy it. More... | |
virtual void | SetOnAssetLoaded (const char *sCallbackScript) |
set the callback script whenever the primary asset is successfully loaded. More... | |
bool | ActivateScript (int func_type, const string &precode, const string &postcode) |
Fire script callback global variable sensor_name and sensor_id will be filled with GetName and GetID, so that caller knows who is firing the callback script. More... | |
bool | ActivateScript (int func_type, const string &precode) |
bool | ActivateScript (int func_type) |
virtual int | GetSelectionEffect () |
get the render effect when character is in selected state. More... | |
virtual void | SetSelectionEffect (int nStyle) |
get the render effect when character is in selected state. More... | |
virtual bool | IsPersistent () |
whether the object is persistent in the world. More... | |
virtual void | SetPersistent (bool bPersistent) |
whenever a persistent object is made non-persistent, the SaveToDB() function will actually removed it from the database and the action can not be recovered. More... | |
virtual void | SetOpacity (float fOpacity) |
virtual float | GetOpacity () |
virtual HRESULT | InitDeviceObjects () |
virtual HRESULT | RestoreDeviceObjects () |
virtual HRESULT | InvalidateDeviceObjects () |
virtual HRESULT | DeleteDeviceObjects () |
virtual HRESULT | RendererRecreated () |
virtual float | GetRenderDistance () |
we will not render this object if the object's position to camera eye position is further than this value. More... | |
virtual void | SetRenderDistance (float fDist) |
virtual int | GetPrimaryTechniqueHandle () |
when batch-rendering a group of objects, objects are usually sorted by their render techniques and then by their primary asset. More... | |
virtual void | SetPrimaryTechniqueHandle (int nHandle) |
Set a new render technique handle. More... | |
virtual CParameterBlock * | GetEffectParamBlock (bool bCreateIfNotExist=false) |
get effect parameter block with this object. More... | |
virtual bool | IsTransparent () |
whether the object contains transparent material. More... | |
virtual void | SetTransparent (bool bIsTransparent) |
Set whether the object is transparent. More... | |
virtual int | GetNumReplaceableTextures () |
get the total number of replaceable textures, which is the largest replaceable texture ID. More... | |
virtual TextureEntity * | GetDefaultReplaceableTexture (int ReplaceableTextureID) |
get the default replaceable texture by its ID. More... | |
virtual TextureEntity * | GetReplaceableTexture (int ReplaceableTextureID) |
get the current replaceable texture by its ID. More... | |
virtual bool | SetReplaceableTexture (int ReplaceableTextureID, TextureEntity *pTextureEntity) |
set the replaceable texture at the given index with a new texture. More... | |
virtual void | OnSelect (int nGroupID) |
called when an object is selected. More... | |
virtual void | OnDeSelect () |
called whenever an object is un-selected. More... | |
virtual void | AddChild (CBaseObject *pObject) |
add another object as the child of this object | |
virtual void | SetParent (CBaseObject *pParent) |
this function is called by parent class to set the child's parent. More... | |
virtual CBaseObject * | GetParent () |
virtual bool | IsDead () |
whether this object should be removed some time in the future. More... | |
virtual void | SetDead () |
virtual void | AddToDeadObjectPool () |
When a child object wants to remove itself, it is usually not safe to do so immediately, instead the object add itself to dead object pool for the root scene to safely remove it at the end of the frame. More... | |
virtual void | Cleanup () |
clean up the object. More... | |
virtual void | Animate (double dTimeDelta, int nRenderNumber=0) |
animate the model by a given delta time. More... | |
virtual HRESULT | Draw (SceneState *sceneState) |
only for drawable objects | |
virtual int | PrepareRender (CBaseCamera *pCamera, SceneState *sceneState) |
derived class can override this function to place the object in to the render pipeline. More... | |
virtual Matrix4 * | GetAttachmentMatrix (Matrix4 &pOut, int nAttachmentID=0, int nRenderNumber=0) |
Get the specified attachment matrix of the current model. More... | |
virtual bool | HasAttachmentPoint (int nAttachmentID=0) |
whether it has an attachment point More... | |
virtual Vector3 * | GetAttachmentPosition (Vector3 &pOut, int nAttachmentID=0, int nRenderNumber=0) |
whether it has an attachment point More... | |
virtual CBipedStateManager * | GetBipedStateManager (bool bCreateOnDemand=true) |
get biped state manager More... | |
virtual void | SetPhysicsGroup (int nGroup) |
set the physics group ID to which this object belongs to default to 0, must be smaller than 32. More... | |
virtual int | GetPhysicsGroup () |
Get the physics group ID to which this object belongs to default to 0, must be smaller than 32. More... | |
virtual void | SetAnimation (int nAnimID) |
Set the current animation id. More... | |
virtual int | GetAnimation () |
get the scaling. More... | |
virtual void | SetAnimFrame (int nFrame) |
set the current animation frame number relative to the beginning of current animation. More... | |
virtual int | GetAnimFrame () |
get the current animation frame number relative to the beginning of current animation. More... | |
virtual void | EnableAnim (bool bAnimated) |
whether animation is enabled. More... | |
virtual bool | IsAnimEnabled () |
virtual void | SetUseGlobalTime (bool bUseGlobalTime) |
whether to use global time to sync animation. More... | |
virtual bool | IsUseGlobalTime () |
whether to use global time to sync animation. More... | |
virtual float | GetPhysicsRadius () |
get the radius for physics simulation. More... | |
virtual Vector3 | GetNormal () |
virtual void | SetNormal (const Vector3 &pNorm) |
virtual void | PushParam () |
Usually, this is used in canvas drawing. More... | |
virtual void | PopParam () |
Usually, this is used in canvas drawing. More... | |
virtual AssetEntity * | GetPrimaryAsset () |
Set scaling. More... | |
virtual const std::string & | GetAssetFileName () |
get asset file name | |
virtual void | SetAssetFileName (const std::string &sFilename) |
set asset file name | |
virtual bool | IsStanding () |
virtual float | GetCtorPercentage () |
Get the object construction percentage (progress) in the range[0,1]. More... | |
virtual void | SetCtorPercentage (float fPercentage) |
Set the object construction percentage (progress) in the range[0,1]. More... | |
virtual void | AutoSelectTechnique () |
automatically select the proper technique for the rendering of the object. More... | |
virtual void | Report (vector< string > &v_sReport) |
virtual HRESULT | ResetTime () |
virtual bool | HasAlphaBlendedObjects () |
return true if the object contains alpha blended render pass. More... | |
virtual void | CompressObject (CompressOption option=(CompressOption) 0xffff) |
Compress the object to save memory. More... | |
virtual IViewClippingObject * | GetViewClippingObject () |
return the view clipping object used for object-level clipping when rendering this object. | |
virtual void | UpdateFrameNumber (int nFrameNumber) |
this function is called to update the render frame number of this object. More... | |
void | SetFrameNumber (int nFrameNumber) |
int | GetFrameNumber () |
get the frame number that this object is last accessed. More... | |
bool | CheckFrameNumber (int nFrameNumber) |
call this function whenever a render may render this object. More... | |
bool | IsLastFrameRendered () |
check to see if the last frame is rendered. More... | |
void | SetMyType (ObjectType t) |
set the type of the object, it tells what this object is used for. More... | |
ObjectType | GetMyType () |
void | SnapToTerrainSurface (bool bUseNorm=true) |
call this function to reset the y component and norm of the object to the global terrain surface at (x,0,z), where (x,y,z) is the object's current position. More... | |
virtual ObjectShape | GetObjectShape () |
get the object shape | |
virtual void | SetObjectShape (ObjectShape shape) |
set the object shape | |
CTerrainTile * | GetTileContainer () |
get the quad-tree terrain tile that this game object is currently visiting. More... | |
virtual void | SetTileContainer (CTerrainTile *val) |
virtual void | UpdateTileContainer () |
update the tile container according to the current position of the game object. More... | |
void | SetHomeZoneName (const char *sName) |
set the home zone name. More... | |
const char * | GetHomeZoneName () |
void | SetSelectGroupIndex (int nGroupIndex=-1) |
set the selection group index. More... | |
int | GetSelectGroupIndex () |
get the selection group index. More... | |
virtual void | SetTileObject (bool bIsTileObject) |
bool | IsGeometryDirty () const |
whether the shape of the object is dirty, such as model, size, facing, local transform is changed. More... | |
void | SetGeometryDirty (bool bDirty=true) |
bool | IsLODEnabled () const |
whether to enable lod if there is lod. More... | |
void | EnableLOD (bool val) |
virtual void | UpdateGeometry () |
this function is usually called after asset file has changed. More... | |
virtual void | SetLocalTransform (const Matrix4 &mXForm) |
set local transform directly | |
virtual void | GetLocalTransform (Matrix4 *localTransform) |
get local transform | |
virtual int | GetMeshTriangleList (std::vector< Vector3 > &output, int nOption=0) |
return triangle list | |
![]() | |
virtual void | GetVertices (Vector3 *pVertices, int *nNumber) |
get all the vertices which can represent the object's shape. More... | |
virtual void | GetRenderVertices (Vector3 *pVertices, int *nNumber) |
same as GetVertices(). More... | |
virtual void | Rotate (float x, float y, float z) |
Rotate the object.This only takes effects on objects having 3D orientation, such as static mesh and physics mesh. More... | |
virtual void | SetRotation (const Quaternion &quat) |
set rotation using a quaternion. More... | |
virtual void | GetRotation (Quaternion *quat) |
get rotation using a quaternion | |
virtual void | SetScaling (float s) |
set the scale of the object. More... | |
virtual float | GetScaling () |
get the scaling. More... | |
virtual Vector3 | GetRenderOffset () |
get the offset(translation) of the object used for rendering. More... | |
virtual void | GetFacing3D (Vector3 *pV) |
get object facing: only for object that has a facing property like biped, not bound facing | |
float | GetFacing () |
same as GetYaw and SetYaw get object facing: only for object that has a facing property like biped, not bound facing The object is facing the positive x axis, if facing is 0. | |
void | SetFacing (float fFacing) |
virtual float | GetPitch () |
get object pitch: is facing the positive x axis, if yaw is 0. | |
virtual void | SetPitch (float fFacing) |
virtual float | GetRoll () |
get object roll: is facing the positive x axis, if yaw is 0. | |
virtual void | SetRoll (float fFacing) |
virtual void | SetTransform (Matrix4 *pLocalTransform, const DVector3 &pGlobalPos, float *pRotation) |
Set a local transform matrix, a global position and a facing value, according to which the object will be transformed on demand, so that the transformed object can be used for efficient object-level view culling in ParaEngine. More... | |
virtual void | SetTransform (Matrix4 *pWorldTransform) |
virtual Matrix4 * | GetRenderMatrix (Matrix4 &out, int nRenderNumber=0) |
return the world matrix of the object for rendering More... | |
virtual Matrix4 * | GetWorldTransform (Matrix4 &pOut, int nRenderNumber=0) |
get world transform | |
virtual bool | TestCollisionSphere (const Vector3 *pvCenter, float radius, BYTE nMethod=1) |
– collision detection More... | |
virtual bool | TestCollisionSphere (CBaseCamera *pCamera, float fFarPlaneDistance) |
assume that the object is a sphere, it will return false if the sphere is completely out of the 6 frustum planes of the camera More... | |
virtual bool | TestShadowSweptSphere (CBaseCamera *pCamera, const Vector3 *pvDirection) |
assume that the object is a sphere, it will return false if the swept sphere along the given direction is completely out of the 6 frustum planes of the camera this function is usually used to test whether we need to render this object as shadow caster, where pvDirection is the current sun direction. | |
virtual bool | TestCollision (CBaseCamera *pCamera) |
check if the object's original shape can be seen via a camera. More... | |
virtual bool | TestCollisionObject (IViewClippingObject *pObj) |
desc: test if the object collide with this object in the world view. More... | |
virtual bool | TestCollisionRay (const Vector3 &vPickRayOrig, const Vector3 &vPickRayDir, float *fDistance) |
Desc: Check the ray intersection with the object input:vPickRayOrig,vPickRayDir: mouse ray params output: fDistance: the distance between the eye and the intersection point. More... | |
virtual float | GetSphereCollisionDepth (Vector3 *pvCenter, float radius, bool bSolveDepth=false) |
desc: this is similar to TestCollisionSphere, but does more than that. More... | |
virtual float | GetObjectCollisionDepth (IViewClippingObject *pObj) |
desc: test if the circle in the y=0 plane collide with this object in the world view Note: radius can be zero. More... | |
virtual float | GetObjectToPointDistance (const Vector3 *pPoint) |
get the distance from the object's surface to a given point. More... | |
virtual void | DrawBoundingBox (SceneState *sceneState, DWORD color) |
debugging only: draw bounding box | |
virtual void | DrawOcclusionObject (SceneState *sceneState) |
draw the occlusion object More... | |
virtual void | DebugDraw (IBatchedElementDraw *pDebugDraw) |
this function is called whenever debugging drawing is enabled. More... | |
![]() | |
virtual const std::string & | GetIdentifier () |
get the name or identifier. More... | |
virtual void | SetIdentifier (const std::string &sID) |
int | GetNameW (std::u16string &out) |
gets the unicode name | |
const std::string & | GetName () |
alias name for GetIdentifier | |
IRefObject * | GetRefObjectByName (const char *sName) |
RefListItem * | GetRefObjectByTag (int nTag) |
get the first reference object by its tag | |
bool | HasReferences () |
RefResult | AddReference (IRefObject *maker, int nTag=0) |
add a new reference. More... | |
RefResult | DeleteReference (IRefObject *ref) |
delete a reference. More... | |
RefResult | DeleteAllRefs () |
Deletes all references of this object. More... | |
int | DeleteAllRefsByTag (int nTag=0) |
Deletes all references whose tag is nTag of this object. More... | |
RefList & | GetRefList () |
get the ref list | |
int | GetRefObjNum () |
get the total number of references | |
RefListItem * | GetRefObject (int nIndex) |
get the referenced object at the given index. More... | |
virtual void | OnRefAdded (IRefObject *rm, int nTag=0) |
This is called after another object added this object to its reference list. More... | |
virtual void | OnRefDeleted (IRefObject *rm) |
This is called after another object deleted this object from its reference list. More... | |
![]() | |
ATTRIBUTE_METHOD1 (IAttributeFields, GetName_s, const char **) | |
ATTRIBUTE_METHOD1 (IAttributeFields, SetName_s, const char *) | |
ATTRIBUTE_METHOD (IAttributeFields, PrintObject_s) | |
ATTRIBUTE_METHOD (IAttributeFields, AddRef_s) | |
ATTRIBUTE_METHOD1 (IAttributeFields, GetRefCount_s, int *) | |
ATTRIBUTE_METHOD1 (IAttributeFields, SetTime_s, int) | |
ATTRIBUTE_METHOD1 (IAttributeFields, GetTime_s, int *) | |
ATTRIBUTE_METHOD (IAttributeFields, Release_s) | |
virtual bool | IsModified () |
whether some of the fields are modified.It is up to the implementation class to provide this functionality if necessary. More... | |
virtual void | SetModified (bool bModified) |
set whether any field has been modified. More... | |
virtual bool | ValidateFields () |
validate all fields and return true if validation passed. More... | |
virtual string | GetValidationMessage () |
get the recent validation message due to the most recent call to ValidateFields() | |
virtual bool | ResetField (int nFieldID) |
Reset the field to its initial or default value. More... | |
virtual bool | InvokeEditor (int nFieldID, const std::string &sParameters) |
Invoke an (external) editor for a given field. More... | |
virtual int | GetTime () |
get the current local time in case it is animated in milli seconds frames. More... | |
virtual void | SetTime (int nTime) |
virtual CDynamicAttributeField * | GetDynamicField (const std::string &sName) |
Get a dynamic field with a given name. More... | |
virtual CDynamicAttributeField * | GetDynamicField (int nIndex) |
Get a dynamic field with a given index. More... | |
virtual const char * | GetDynamicFieldNameByIndex (int nIndex) |
get field name by index | |
virtual int | GetDynamicFieldCount () |
how many dynamic field this object currently have. More... | |
virtual int | SetDynamicField (const std::string &sName, const CVariable &value) |
set a dynamic field with a given name. More... | |
virtual int | AddDynamicField (const std::string &sName, ATTRIBUTE_FIELDTYPE dwType) |
add dynamic field and return field index | |
virtual void | RemoveAllDynamicFields () |
remove all dynamic fields | |
virtual int | SaveDynamicFieldsToString (std::string &output) |
save only text dynamic fields to fieldname = value text strings. More... | |
virtual int | LoadDynamicFieldsFromString (const std::string &input) |
load only text dynamic fields from string More... | |
CAttributeClass * | GetAttributeClass () |
get the main attribute class object. More... | |
void | PrintObject () |
print the content of this object to a text file at temp/doc/[ClassName].txt. More... | |
![]() | |
virtual void | Clone (IObject *obj) const |
Clone the object's contains to a pointer. More... | |
virtual IObject * | Clone () const |
Clone the object's contains and return a pointer to the newly created object. More... | |
virtual bool | Equals (const IObject *obj) const |
Compare the object with another object. More... | |
virtual const IType * | GetType () const |
virtual std::string | ToString () const |
WeakPtr_type & | GetWeakReference () |
get weak reference object. More... | |
virtual int | ProcessObjectEvent (const ObjectEvent &event) |
this function is only used to backward compatibility of ParaObject:AddEvent() function. More... | |
![]() | |
void | addref () const |
add reference count of the object. More... | |
bool | delref () const |
decrease reference count of the object. More... | |
int | GetRefCount () const |
get the reference count | |
virtual int | Release () |
CRefCounted * | AddToAutoReleasePool () |
addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More... | |
![]() | |
void | SetHeadOnText (const char *sText, int nIndex=0) |
set the text to be displayed on head on display | |
const char * | GetHeadOnText (int nIndex=0) |
Get the text to be displayed on head on display. | |
void | SetHeadOnUITemplateName (const char *sUIName, int nIndex=0) |
set which UI control the head on display will be used as a template for drawing the text it can be a single CGUIText Object or it can be a container with a direct children called "text" if this is "" or empty, the default UI template will be used. More... | |
const char * | GetHeadOnUITemplateName (int nIndex=0) |
get which UI control the head on display will be used as a template for drawing the text it can be a single CGUIText Object or it can be a container with a direct children called "text" if this is "" or empty, the default UI template will be used. More... | |
const std::string & | GetHeadOnUITemplateNameS (int nIndex=0) |
virtual CGUIBase * | GetHeadOnUIObject (int nIndex=0) |
void | SetHeadOnTextColor (DWORD color, int nIndex=0) |
set the text to be displayed on head on display | |
DWORD | GetHeadOnTextColor (int nIndex=0) |
Get the text to be displayed on head on display. | |
void | SetHeadOnOffest (const Vector3 &vOffset, int nIndex=0) |
set the offset where head on display should be rendered relative to the origin or head of the host 3d object | |
void | GetHeadOnOffset (Vector3 *pOut, int nIndex=0) |
Get the offset where head on display should be rendered relative to the origin or head of the host 3d object. | |
void | ShowHeadOnDisplay (bool bShow, int nIndex=0) |
show or hide object's head on display | |
bool | IsHeadOnDisplayShown (int nIndex=0) |
whether the object head on display shall be visible | |
bool | IsHeadOnZEnabled (int nIndex=0) |
whether z buffer test is enabled for Head On display. More... | |
void | SetHeadOnZEnabled (bool bZnabled, int nIndex=0) |
set if z buffer test is enabled for Head On display. More... | |
virtual bool | HasHeadOnDisplay (int nIndex=0) |
whether the object contains head on display at given index | |
bool | IsHeadOn3DScalingEnabled (int nIndex=0) |
Enable 3d scaling. More... | |
void | SetHeadOn3DScalingEnabled (bool bZnabled, int nIndex=0) |
Enable 3d scaling. | |
bool | IsHeadOnUseGlobal3DScaling (int nIndex=0) |
this is only used when m_bEnable3DScaling. More... | |
void | SetHeadOnUseGlobal3DScaling (bool bZnabled, int nIndex=0) |
this is only used when m_bEnable3DScaling. More... | |
void | SetHeadOnNearZoomDist (float fValue, int nIndex=0) |
float | GetHeadOnNearZoomDist (int nIndex=0) |
void | SetHeadOnFarZoomDist (float fValue, int nIndex=0) |
float | GetHeadOnFarZoomDist (int nIndex=0) |
void | SetHeadOnMinUIScaling (float fValue, int nIndex=0) |
float | GetHeadOnMinUIScaling (int nIndex=0) |
void | SetHeadOnMaxUIScaling (float fValue, int nIndex=0) |
float | GetHeadOnMaxUIScaling (int nIndex=0) |
void | SetHeadOnAlphaFadePercentage (float fValue, int nIndex=0) |
float | GetHeadOnAlphaFadePercentage (int nIndex=0) |
void | SetHeadOn3DFacing (float fValue, int nIndex=0) |
turn on 3d facing when this function is called | |
float | GetHeadOn3DFacing (int nIndex=0) |
![]() | |
virtual bool | AddScriptCallback (int func_type, const string &script_func) |
add a new call back handler. More... | |
virtual ScriptCallback * | GetScriptCallback (int func_type) |
return NULL if there is no associated script. More... | |
virtual bool | RemoveScriptCallback (int func_type) |
remove a call back handler | |
Public Attributes | |
BOOL | m_bIsFollowMode |
true to follow target | |
bool | m_bIsLastFrameChanged |
true if the camera is changed since last frame | |
friend | CSceneObject |
friend | ShadowVolume |
Additional Inherited Members | |
![]() | |
static void | SetKeyMap (CharacterAndCameraKeys key, BYTE scancode) |
static BYTE | GetKeyMap (CharacterAndCameraKeys key) |
![]() | |
static CBaseObject * | GetObjectByID (int nID) |
GetObject By ID. More... | |
![]() | |
static HRESULT | GetAttributeClassID_s (IAttributeFields *cls, int *p1) |
static HRESULT | GetAttributeClassName_s (IAttributeFields *cls, const char **p1) |
static bool | OpenWithDefaultEditor (const char *sFilename, bool bWaitOnReturn=false) |
Open a given file with the default registered editor in the game engine. More... | |
![]() | |
static bool | DrawHeadOnUI (CBaseObject *pObj, int &nCounter, SceneState *pSceneState=NULL, CGUIText **ppObjUITextDefault=NULL, bool bZEnablePass=true, bool b3DTextPass=false) |
draw the headon UI of a specified object. More... | |
static bool | BeginPaint (SceneState *pSceneState, bool b3DTextPass, bool bZEnablePass) |
HeadOn UI needs to be drawn between BeginPaint and EndPaint, which is usually automatically when the first and last head on UI is called. More... | |
static void | EndPaint (SceneState *pSceneState, bool b3DTextPass) |
![]() | |
static BYTE | m_scancode_key_map [MAX_KEYS] |
![]() | |
virtual CharacterAndCameraKeys | MapKey (UINT nKey) |
BOOL | IsKeyDown (BYTE key) |
BOOL | WasKeyDown (BYTE key) |
void | ConstrainToBoundary (DVector3 *pV) |
Clamps pV to lie inside m_vMinBoundary & m_vMaxBoundary. | |
void | UpdateMouseDelta (float fElapsedTime) |
void | UpdateMouseDelta (int nDX, int nDY) |
void | UpdateVelocity (float fElapsedTime) |
void | SetMovementDrag (bool bEnable) |
If true, then camera movement will slow to a stop otherwise movement is instant. More... | |
bool | GetMovementDrag () |
void | SetTotalDragTime (float fTime) |
Time it takes for velocity to go from full to 0. More... | |
float | GetTotalDragTime () |
![]() | |
virtual CAttributeClass * | CreateAttributeClass () |
initialize fields | |
virtual CDynamicAttributesSet * | GetDynamicAttributes (bool bCreateIfNotExist=false) |
![]() | |
CCameraFrustum | m_frustum |
camera view frustum | |
CCameraFrustum | m_frustum_object |
object view frustum, this is smaller than m_frustum; its far plane is set at fog end | |
CCameraFrustum | m_frustum_shadow |
shadow view frustum, this is smaller than m_frustum_object; its far plane is set at a fixed size, such as the smaller of 50 and fog end | |
CPortalFrustum | m_frustum_portal |
portal frustum with many planes formed by the portal vertices and the camera eye position. More... | |
Plane | m_fog_plane |
this is the fog end plane, it is plane with normal of the eye vector and distance of the fog range because fogs in ParaEngine is emulated linearly along the camera z axis, we need this to decide whether a shape is completely in fog or not. | |
DVector3 | m_vEyeReferencePoint |
: the eye position is always added by the m_vEyeReferencePoint when changed it is initialized to be (0,0,0). More... | |
Matrix4 | m_mView |
Matrix4 | m_mProj |
BYTE | m_aKeys [MAX_KEYS] |
POINT | m_ptLastMousePosition |
bool | m_bMouseLButtonDown |
bool | m_bMouseMButtonDown |
bool | m_bMouseRButtonDown |
int | m_nCurrentButtonMask |
int | m_nMouseWheelDelta |
Vector2 | m_vMouseDelta |
float | m_fFramesToSmoothMouseData |
DVector3 | m_vDefaultEye |
DVector3 | m_vDefaultLookAt |
DVector3 | m_vEye |
DVector3 | m_vLookAt |
float | m_fCameraYawAngle |
float | m_fCameraPitchAngle |
Vector3 | m_vVelocity |
bool | m_bMovementDrag |
Vector3 | m_vVelocityDrag |
FLOAT | m_fDragTimer |
FLOAT | m_fTotalDragTimeToZero |
Vector2 | m_vRotVelocity |
float | m_fFOV |
float | m_fAspect |
float | m_fNearPlane |
float | m_fFarPlane |
float | m_fOrthoWidth |
float | m_fOrthoHeight |
bool | m_bIsPerspectiveView |
float | m_fRotationScaler |
float | m_fMoveScaler |
bool | m_bInvertPitch |
bool | m_bEnablePositionMovement |
bool | m_bEnableYAxisMovement |
bool | m_bClipToBoundary |
DVector3 | m_vMinBoundary |
DVector3 | m_vMaxBoundary |
bool | m_bResetCursorAfterMove |
Matrix4 | m_mCameraWorld |
![]() | |
DVector3 | m_vPos |
position is always at the bottom center of the bounding shape. More... | |
CShapeAABB | m_aabb |
bounding box of containing object. More... | |
float | m_fYaw |
yaw or facing | |
float | m_fRadius |
radius of m_aabb | |
![]() | |
int | m_nID |
the ID of the object. More... | |
DWORD | m_dwAttribute |
volume type and attribute of this object. More... | |
CChildObjectList_Type | m_children |
child objects array: we keep strong references (ref counted) to child objects | |
ObjectType | m_objType |
type of the object | |
CTerrainTile * | m_tileContainer |
int32 | m_nTechniqueHandle |
the primary technique handle | |
int32 | m_nFrameNumber |
the frame number that this object is last accessed. More... | |
int32 | m_nSelectGroupIndex |
this is the selection group index. More... | |
int32 | m_nRenderImportance |
the larger, the more important. More... | |
float | m_fRenderOrder |
0 if automatic, larger number renders after smaller numbered object. More... | |
float | m_fRenderDistance |
we will not render this object if the object's position to camera eye position is further than this value. More... | |
CParameterBlock * | m_pEffectParamBlock |
effect param block that should be applied to m_nTechniqueHandle | |
bool | m_bGeometryDirty: 1 |
whether the shape of the object is dirty, such as model, size, facing, local transform is changed. More... | |
bool | m_bEnableLOD: 1 |
whether to enable lod if there is lod. More... | |
![]() | |
RefList | m_references |
This is the list of active references that refer to us. | |
std::string | m_sIdentifer |
unit name used in the scripting language | |
![]() | |
WeakPtr_type | m_weak_reference |
![]() | |
int | m_refcount |
![]() | |
ObjectCallbackPool_Type | m_callback_scripts |
the NPL script handlers | |
![]() | |
static int | g_nObjectSelectionEffect = ParaEngine::RenderSelectionStyle_border |
enum of RenderSelectionStyle More... | |
Auto Camera is designed to handle smooth transitions between supported camera type, such as first person camera, third person camera, and rotation camera.
It can be set to follow a Biped Object in the scene. The Scene Object automatically creates one instance of this object when loading; and manages the entire camera automatically.
CAutoCamera::CAutoCamera | ( | void | ) |
old value is 5. I set 20 is for debugging purposes
void CAutoCamera::ComputeViewMatrix | ( | Matrix4 * | pOut, |
const DVector3 * | pEye, | ||
const DVector3 * | pAt, | ||
const Vector3 * | pUp | ||
) |
compute view matrix by coordinate in world space.
This will internally transform according to current render offset. in case stereo vision is enabled, the eye shift distance is applied secretly here. This is tricky for generating stereo image.
Update the view matrix
void ParaEngine::CAutoCamera::EnableAlwaysRotateCameraWhenFPS | ( | bool | bValue | ) |
Default to true.
if the camera mode is CameraCameraFirstPerson, moving the mouse will rotate the camera, otherwise only rotate when right mousebutton is down.
|
inline |
set whether camera dragging with left button if enabled.
default to true
|
inline |
set whether camera dragging with right button if enabled.
default to true
|
inline |
whether to enable stereo vision.
When stereo vision is enabled via software mode, we will shift the eye position relative to the look at position by stereo shift distance, when computing the view matrix.
void CAutoCamera::FollowBiped | ( | CBaseObject * | pBiped, |
CameraMode | modeCamera, | ||
double | dTransitionTime | ||
) |
Desc: Get the mouse pay for object picking [in] dTransitionTime: can be 0 or greater than 0 when dTransitionTime is zero, the camera is focuses on the biped from no where if dTransitionTime is greater than 0, the camera will smoothly move to the biped.
void CAutoCamera::FollowBiped | ( | CBaseObject * | pBiped, |
int | nTranstionMode, | ||
int | modeCamera, | ||
double | Param0, | ||
double | Param1, | ||
double | Param2 | ||
) |
pBiped can be nil, in which case the same biped is followed.
Transition 1 (default) smooth move 0 intermediate move
Mode <integer> CameraFollowFirstPerson = 2, // First person view of the Target object CameraFollowThirdPerson = 3, // Third person view, allow rotation, character centered CameraFollowDefault = 5, // Third person view, disable rotation, character CameraCameraFirstPerson = 11 // Camera as a first person.
Parameters means difficult things under different mode – CameraFollowFirstPerson, // First person view of the Target object param0->m_fCameraObjectDistance; // follow first person radius param1->m_fCameraLiftupAngle; // follow first person lift up angle, this is a constant usually Pi/4: 45 degrees – CameraFollowThirdPerson, // Third person view, allow rotation, character centered param0->m_fFTPRadius; // follow Third person radius param1->m_fFTPFacing; // follow Third person: camera facing param2->m_fFTPAngle; // follow Third person lift up angle, this is a constant usually Pi/4: 45 degrees – CameraFollowDefault: Third person view, disable rotation, character restricted to a rectangular CameraConstraint m_constrantsFollow; // define the camera constraints for follow default mode param0->m_fDEFAngle; // follow default lift up angle, this is a constant usually Pi/4: 45 degrees param1->m_fDEFHeight; – CameraCameraFirstPerson // Camera as a first person. CameraConstraint m_constrants; param0->m_vEye.x + biped.x param1->m_vEye.y + biped.y param2->m_vEye.z + biped.z
follow the biped with a camera mode
set camera mode
set params.
|
virtual |
Call these from client and use Get*Matrix() to read new matrices.
Desc: Update the view matrix based on user input & elapsed time.
get character position
get character radius and height
set the camera speed according to the character's speed
Adjust parameters from user input
Process key events.
stop the biped, when no movement key is down.
process the mouse wheel delta: changing camera-object distance
process the mouse Y delta: changing the lift-up angle if the right mouse button is pressed.
angle constraint
process the mouse X delta.
if camera is locked, the mouse x delta will move the camera
the vector from the new look at position to the new camera eye position.
Implement the occlusion constraint as below: Input:
the vector from the new look at position to the new camera eye position.
correction with block terrain engine
the following code implements smooth roll back of the camera.
smooth translate the camera to the new target move eye and look at point smoothly to the new value.
For all kinds of cameras, we ensure that the near plane rectangular and the eye position is well above the global terrain surface. This is done by ensuring that all the five points(four for the near plane, one for the camera eye) has height (or Y component) at least larger than the global terrain at their (x,z) location. I have also used a simple but approximated method to avoid camera near frustum intersect with the physics mesh. this is done by casting a ray from the center of the near plane downward to see if it intersects with the physics mesh. Input:
check for global terrain.
ignore camera collision with the terrain object, if the camera is well below the terrain surface.(may be in a cave or something) 2 meters is just an arbitrary value.
check for physical meshes.
we will check three points around the near plane.
shift the distance
should regenerate render origin whenever the camera moves.
the following is only here to repair floating point accuracy. Is there a better way in the future?
Update the view matrix
Update the view matrix
speed to go from opaque to fully transparent and vice versa
Reimplemented from ParaEngine::CFirstPersonCamera.
void CAutoCamera::FreeCameraMode | ( | ) |
switch to free camera mode
reset view parameters for camera, so to begin free camera navigation from where the camera is positioned.
|
inline |
additional camera rotation in camera space.
default to 0
|
inlinevirtual |
attribute class ID should be identical, unless one knows how overriding rules work.
Reimplemented from ParaEngine::CBaseCamera.
int ParaEngine::CAutoCamera::GetCharacterLookupBoneIndex | ( | ) |
-1 to disable, otherwise this is the attachment bone id to which we will bind the camera's lookup to.
CEventBinding * CAutoCamera::GetEventBinding | ( | ) |
Get the current event binding object.
this may return NULL.
float ParaEngine::CAutoCamera::GetMaxAllowedYShift | ( | ) |
we will smooth the camera movement on the y direction when the followed biped's y movement is smaller than this value.
float ParaEngine::CAutoCamera::GetMaxYShiftSpeed | ( | ) |
the max speed camera interpolation speed along y axis.
this is actually MaxAllowedYShift*MaxYShiftSpeed.
ParaEngine::Vector3 ParaEngine::CAutoCamera::GetRenderOrigin | ( | ) |
current render origin.
void CAutoCamera::HandleUserInput | ( | ) |
Handle the user input from direct input: update the key state, process key event, process mouse event.
|
virtual |
this class should be implemented if one wants to add new attribute.
This function is always called internally.
Reimplemented from ParaEngine::CBaseCamera.
|
inline |
always running
bool ParaEngine::CAutoCamera::IsBlockInput | ( | ) |
whether to block all user input (both key and mouse).
Input is usually blocked as a game logics, such as we do not want the user to control the player anymore.
|
inline |
whether camera is locked behind the current character.
bool ParaEngine::CAutoCamera::IsControlBiped | ( | ) | const |
whether the camera is able to control the biped movement.
bool ParaEngine::CAutoCamera::IsEnableBlockCollision | ( | ) | const |
enabled by default.
otherwise camera will pass through blocks
|
inline |
whether camera dragging with left button if enabled.
default to true
|
inline |
whether camera dragging with right button if enabled.
default to true
|
inline |
enabled by default.
if enabled, we will ignore camera-block collision, when both eye and the look-at point are in sunlight.
bool ParaEngine::CAutoCamera::IsLockMouseWhenDragging | ( | ) | const |
whether to lock mouse during dragging, default to false.
On FPS mode, one should enable or manually lock the mouse.
bool CAutoCamera::IsUseCharacterLookup | ( | ) |
whether the camera look up vector will use the character look up.
Default to false, where the look up vector is always (0,1,0)
bool CAutoCamera::IsUseCharacterLookupWhenMounted | ( | ) |
Default to true.
It will enable character lookup when biped is mounted.
void CAutoCamera::LoadDefaultEventBinding | ( | ) |
load the default camera key and mouse event binding.
|
virtual |
called every frame move when this character is sentient.
This is most likely used by active AI controllers, such as movie controller.
|
inline |
lift up angle of the camera.
Camera Pitch
|
inline |
additional camera offset in camera space.
void CAutoCamera::SetCameraObjectDistance | ( | double | fDist | ) |
the camera object distance after all kinds of constraints are applied.
|
inline |
the camera roll back speed in meters per second.
if this value is larger than INFINITY, there will be on smooth animations.
|
inline |
rotation of the camera around the X axis, in the world coordinate.
Camera Pitch
|
inline |
rotation of the camera around the Y axis, in the world coordinate.
Camera Yaw
|
inline |
rotation of the camera around the Z axis, in the world coordinate.
Camera Roll
void ParaEngine::CAutoCamera::SetCharacterLookupBoneIndex | ( | int | nIndex | ) |
-1 to disable, otherwise this is the attachment bone id to which we will bind the camera's lookup to.
void ParaEngine::CAutoCamera::SetControlBiped | ( | bool | val | ) |
whether the camera is able to control the biped movement.
void ParaEngine::CAutoCamera::SetKeyboardMovVelocity | ( | float | fValue | ) |
max speed of movement velocity using keyboard.
this is used in free camera mode.
fValue |
void ParaEngine::CAutoCamera::SetKeyboardRotVelocity | ( | float | fValue | ) |
max speed of rotational velocity using keyboard.
this is used in free camera mode.
fValue |
|
inline |
the Y shift of the camera look at position during follow mode.
the biped's height will add this value to get the real look at position
|
inline |
max camera object distance when mouse wheel is used for zooming.
|
inline |
min camera object distance when mouse wheel is used for zooming.
|
inline |
this is usually half of the Stereo eye separation distance.
negative value is left eye, positive value is right eye.
void CAutoCamera::SetUseCharacterLookup | ( | bool | bUseCharacterLookup | ) |
whether the camera look up vector will use the character look up.
Default to false, where the look up vector is always (0,1,0)
void CAutoCamera::SetUseCharacterLookupWhenMounted | ( | bool | bUseCharacterLookup | ) |
Default to true.
It will enable character lookup when biped is mounted.
bool CAutoCamera::SmoothMove | ( | DVector3 * | result, |
DVector3 | vPosTarget, | ||
DVector3 | vPos, | ||
float | fIncrease, | ||
float | fTolerance = 0 |
||
) |
linearly (smoothly) move vPos to vPosTarget by the amount fIncrease
void CAutoCamera::UpdateViewMatrix | ( | ) |
it calls ComputeViewMatrix() with the current eye settings.
In most cases, this function is called automatically. However, when rendering stereo vision, one may need to call this function manually.
Update the view matrix