My Project
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ParaEngine::CBaseObject Class Reference

Defines the base class of all scene elements:CBaseObject for Parallel World Engine. More...

#include <BaseObject.h>

Inheritance diagram for ParaEngine::CBaseObject:
ParaEngine::IViewClippingObject ParaEngine::IHeadOn3D ParaEngine::IObjectScriptingInterface ParaEngine::IRefObject ParaEngine::IAttributeFields ParaEngine::IObject ParaEngine::CRefCounted ParaEngine::C3DCanvas ParaEngine::CContainerObject ParaEngine::CDynamicObject ParaEngine::CGeosetObject ParaEngine::CManagedLoader ParaEngine::CRenderTarget ParaEngine::CSceneObject ParaEngine::CSphereObject ParaEngine::CTileObject ParaEngine::CWeatherEffect ParaEngine::CZoneNode ParaEngine::WeatherParticleSpawner

Public Types

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, CBaseObjectWeakPtr_type
 
typedef unordered_ref_array< CBaseObject * > CChildObjectList_Type
 
typedef std::list< ObjectEventObjectEventList_Type
 
- Public Types inherited from ParaEngine::IAttributeFields
typedef ParaEngine::weak_ptr< IObject, IAttributeFieldsWeakPtr_type
 
- Public Types inherited from ParaEngine::IObject
typedef ParaEngine::weak_ptr< IObjectWeakPtr_type
 
- Public Types inherited from ParaEngine::IObjectScriptingInterface
typedef std::vector< ScriptCallbackObjectCallbackPool_Type
 

Public Member Functions

virtual CBaseObject::_SceneObjectType GetType ()
 
virtual void Clone (CBaseObject *obj)
 Clone the object's contains to a pointer. More...
 
virtual CBaseObjectClone ()
 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 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...
 
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 IAttributeFieldsGetChildAttributeObject (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 IAttributeFieldsGetChildAttributeObject (int nRowIndex, int nColumnIndex=0)
 
virtual bool IsGlobal ()
 whether this object is global. More...
 
bool IsBiped ()
 
virtual IGameObjectQueryIGameObject ()
 this may return NULL, if the object does not implement the IGameObject interface. More...
 
virtual IAttributeFieldsGetAttributeObject ()
 
bool CheckVolumnField (DWORD volType)
 Use CheckAttribute()
 
virtual TextureEntityGetTexture ()
 
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.
 
CZoneNodeGetHomeZone ()
 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_TypeGetChildren ()
 – Base object functions
 
CBaseObjectGetChildByName (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 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 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 CParameterBlockGetEffectParamBlock (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 TextureEntityGetDefaultReplaceableTexture (int ReplaceableTextureID)
 get the default replaceable texture by its ID. More...
 
virtual TextureEntityGetReplaceableTexture (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 CBaseObjectGetParent ()
 
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 Matrix4GetAttachmentMatrix (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 Vector3GetAttachmentPosition (Vector3 &pOut, int nAttachmentID=0, int nRenderNumber=0)
 whether it has an attachment point More...
 
virtual CBipedStateManagerGetBipedStateManager (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 void SetPhysicsGroupMask (DWORD dwValue)
 set groups Mask used to filter physics objects, default to 0xffffffff
 
virtual DWORD GetPhysicsGroupMask ()
 get groups Mask used to filter physics objects, default to 0xffffffff
 
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 void Reset ()
 reset the object to its default settings. More...
 
virtual DVector3 GetPosition ()
 always bottom center of the bounding shape
 
virtual void SetPosition (const DVector3 &v)
 always bottom center of the bounding shape
 
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 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 AssetEntityGetPrimaryAsset ()
 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 IViewClippingObjectGetViewClippingObject ()
 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
 
CTerrainTileGetTileContainer ()
 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 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 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
 
- Public Member Functions inherited from ParaEngine::IViewClippingObject
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 GetVerticesWithOrigin (const Vector3 *vOrigin, Vector3 *pVertices, int *nNumber)
 
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 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 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 GetYaw ()
 get object Yaw: is facing the positive x axis, if yaw is 0.
 
virtual void SetYaw (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 GetOBB (CShapeOBB *obb)
 get the oriented bounding box in world space. More...
 
virtual void GetAABB (CShapeAABB *aabb)
 
virtual void SetAABB (const Vector3 *vMin, const Vector3 *vMax)
 Set local AABB information. More...
 
virtual Vector3 GetLocalAABBCenter ()
 
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 Matrix4GetRenderMatrix (Matrix4 &out, int nRenderNumber=0)
 return the world matrix of the object for rendering More...
 
virtual Matrix4GetWorldTransform (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...
 
- Public Member Functions inherited from ParaEngine::IRefObject
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
 
IRefObjectGetRefObjectByName (const char *sName)
 
RefListItemGetRefObjectByTag (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...
 
RefListGetRefList ()
 get the ref list
 
int GetRefObjNum ()
 get the total number of references
 
RefListItemGetRefObject (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...
 
- Public Member Functions inherited from ParaEngine::IAttributeFields
 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 CDynamicAttributeFieldGetDynamicField (const std::string &sName)
 Get a dynamic field with a given name. More...
 
virtual CDynamicAttributeFieldGetDynamicField (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...
 
CAttributeClassGetAttributeClass ()
 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...
 
- Public Member Functions inherited from ParaEngine::IObject
virtual void Clone (IObject *obj) const
 Clone the object's contains to a pointer. More...
 
virtual IObjectClone () 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 ITypeGetType () const
 
virtual std::string ToString () const
 
WeakPtr_typeGetWeakReference ()
 get weak reference object. More...
 
virtual int ProcessObjectEvent (const ObjectEvent &event)
 this function is only used to backward compatibility of ParaObject:AddEvent() function. More...
 
- Public Member Functions inherited from ParaEngine::CRefCounted
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 ()
 
CRefCountedAddToAutoReleasePool ()
 addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More...
 
- Public Member Functions inherited from ParaEngine::IHeadOn3D
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 CGUIBaseGetHeadOnUIObject (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)
 
- Public Member Functions inherited from ParaEngine::IObjectScriptingInterface
virtual bool AddScriptCallback (int func_type, const string &script_func)
 add a new call back handler. More...
 
virtual ScriptCallbackGetScriptCallback (int func_type)
 return NULL if there is no associated script. More...
 
virtual bool RemoveScriptCallback (int func_type)
 remove a call back handler
 

Static Public Member Functions

static CBaseObjectGetObjectByID (int nID)
 GetObject By ID. More...
 
- Static Public Member Functions inherited from ParaEngine::IAttributeFields
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 Public Member Functions inherited from ParaEngine::IHeadOn3D
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)
 

Protected Attributes

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
 
CTerrainTilem_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...
 
CParameterBlockm_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...
 
- Protected Attributes inherited from ParaEngine::IRefObject
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
 
- Protected Attributes inherited from ParaEngine::IObject
WeakPtr_type m_weak_reference
 
- Protected Attributes inherited from ParaEngine::CRefCounted
int m_refcount
 
- Protected Attributes inherited from ParaEngine::IObjectScriptingInterface
ObjectCallbackPool_Type m_callback_scripts
 the NPL script handlers
 

Static Protected Attributes

static int g_nObjectSelectionEffect = ParaEngine::RenderSelectionStyle_border
 enum of RenderSelectionStyle More...
 

Additional Inherited Members

- Protected Member Functions inherited from ParaEngine::IAttributeFields
virtual CAttributeClassCreateAttributeClass ()
 initialize fields
 
virtual CDynamicAttributesSetGetDynamicAttributes (bool bCreateIfNotExist=false)
 

Detailed Description

Defines the base class of all scene elements:CBaseObject for Parallel World Engine.

It is generally an abstract class, which means that it doe snot contain data structure. However, it provides many virtual functions that may be called many times by other modules(such as Environment Simulator and AI Simulator ), so that inherited class could has their own implementations.

The virtual functions falls into several class: (1) object property query: like position, facing, radius,height, volume type, etc. (2) object collision detection: like TestCollisionObject, TestCollisionSphere, etc. it only contains functions that carry out the actual collision detection, NOT implementing any collision detection algorithm in large scale. (3) frame move: Animate(). Note this is only implemented by [meta]biped and sceneRoot objects which will actually handle events. All other scene objects' frame move will be handled by classes other than their own. Those classes may be environment simulator and game Interface and Rule controller. (4) Rendering: Almost all object use Draw() method to render itself. Some objects like Biped needs an additional AdvanceTime(). Since most of the time draw() method only draws a static scene, while AdvanceTime() will advance the animation frame used by an animation based object. Some animated object like Sprite does not have this AdvanceTime(); this is either because the frame advance needs very little computation time or its animation frame doe snot need to be precise. So Sprite object is treated like a static object, and it doe snot have AdvanceTime() like other animated ones.

Base object class also kept common and shared data structures and functions (1) Object Type and Identifier (2) tree nodes management: m_children (3) Event management

Note: It is not suggested to have too many inherited class of this class in depth, because it will induce too many data space waste. As you may see, I have used as few data words as possible in this set of classes. Note[2004/5/3]: All inherited object should deallocate anything in the Cleanup() which is called by the destructor of the BaseObject. Because the destruction of any inherited class are not guaranteed to be called when it's deleted. Pay attention to any member object like(string) which may depends on the destructor to release its resources.

Member Enumeration Documentation

§ NPL_STRING

by which method an object is converted to NPL string.

Enumerator
NPL_CREATE 

create the object in NPL

NPL_CREATE_IN_LOADER 

create the object in managed loader in NPL

NPL_UPDATE 

Update the object in NPL, which is delete the object first, then create it again. this is useful to update the static physics if any.

NPL_DELETE 

delete the object in NPL

NPL_DONOT_OUTPUT_ASSET 

whether to suppress the asset creation code.

Member Function Documentation

§ ActivateScript()

bool CBaseObject::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.

Parameters
func_typeit should be type CallBackType
precodescript to be called before the callback script
postcodescript to be called after the callback script

§ AddChildAttributeObject()

bool CBaseObject::AddChildAttributeObject ( IAttributeFields pChild,
int  nRowIndex = -1,
int  nColumnIndex = 0 
)
virtual

add child object.

Reimplemented from ParaEngine::IAttributeFields.

§ AddToDeadObjectPool()

void CBaseObject::AddToDeadObjectPool ( )
virtual

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.

§ Animate()

void CBaseObject::Animate ( double  dTimeDelta,
int  nRenderNumber = 0 
)
virtual

animate the model by a given delta time.

Parameters
dTimeDeltadelta time in seconds
nRenderNumberif 0 it means that it is always animated, otherwise we should only animate if previous call of this function has a different render frame number than this one.

Reimplemented in ParaEngine::CSceneObject, ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, ParaEngine::CMeshObject, ParaEngine::CMissileObject, ParaEngine::CWeatherEffect, ParaEngine::CBlockDynamicObject, and ParaEngine::CContainerObject.

§ AutoSelectTechnique()

void CBaseObject::AutoSelectTechnique ( )
virtual

automatically select the proper technique for the rendering of the object.

This method is automatically called by the render pipeline before rendering any potentially visible object. Please note that: When rendering some special pass, the render pipeline might select a different technique and then select back.

Reimplemented in ParaEngine::CMeshPhysicsObject.

§ CanPick()

bool CBaseObject::CanPick ( )

get whether object can be picked by mouse picking.

§ CheckAttribute()

bool ParaEngine::CBaseObject::CheckAttribute ( DWORD  attribute)
inline

whether an object attribute is enabled.

Parameters
attribute
Returns
true if enabled

§ CheckFrameNumber()

bool CBaseObject::CheckFrameNumber ( int  nFrameNumber)

call this function whenever a render may render this object.

it will call UpdateFrameNumber virtual function.

Returns
return true if nFrameNumber is different from the current frame number and set it to nFrameNumber before return..

§ Cleanup()

virtual void ParaEngine::CBaseObject::Cleanup ( )
inlinevirtual

§ Clone() [1/2]

void CBaseObject::Clone ( CBaseObject obj)
virtual

Clone the object's contains to a pointer.

The caller should allocate the memory and pass the pointer to this function.. Inheritance should implement this function void Clone(IObject*) and IObject* Clone() should have the same behavior In some cases, if you want to avoid Dead Reference( one object is being referred to by many objects and you can't update all the references). It is possible to use this function to replace the contains at a given pointer. But this may result in memory leak if you do not implement this function carefully or misuse it.

§ Clone() [2/2]

CBaseObject * CBaseObject::Clone ( )
virtual

Clone the object's contains and return a pointer to the newly created object.

The caller should free the memory of the return object. Inheritance should implement this function void Clone(IObject*) and IObject* Clone() should have the same behavior

§ CompressObject()

void CBaseObject::CompressObject ( CompressOption  option = (CompressOption)0xffff)
virtual

Compress the object to save memory.

Only compress an object if you believe if will not be needed for a while. a compressed object can always be recovered automatically.

Reimplemented in ParaEngine::CMeshPhysicsObject, and ParaEngine::CManagedLoader.

§ DestroyChildByName()

int CBaseObject::DestroyChildByName ( const string &  name,
bool  bRecursive = false 
)

destroy a child by name.

It returns the number of nodes that are destroyed. the current version will only destroy the first child with the given name.

§ DestroyChildren()

void CBaseObject::DestroyChildren ( )
virtual

Completely destroy child nodes from memory recursively.

This is often called by the root scene at application clean up

Reimplemented in ParaEngine::CMiniSceneGraph.

§ EnableAnim()

virtual void ParaEngine::CBaseObject::EnableAnim ( bool  bAnimated)
inlinevirtual

whether animation is enabled.

by default this is true. During movie editing, we may disable animation, set animation frame explicitly by editor logics.

Reimplemented in ParaEngine::CBipedObject, and ParaEngine::BMaxObject.

§ EnablePhysics()

void CBaseObject::EnablePhysics ( bool  bEnable)
virtual

this function will turn on or off the physics of the object.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, and ParaEngine::BMaxObject.

§ GetAnimation()

virtual int ParaEngine::CBaseObject::GetAnimation ( )
inlinevirtual

§ GetAnimFrame()

virtual int ParaEngine::CBaseObject::GetAnimFrame ( )
inlinevirtual

get the current animation frame number relative to the beginning of current animation.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, ParaEngine::BMaxObject, and ParaEngine::CMeshObject.

§ GetAttachmentMatrix()

Matrix4 * CBaseObject::GetAttachmentMatrix ( Matrix4 pOut,
int  nAttachmentID = 0,
int  nRenderNumber = 0 
)
virtual

Get the specified attachment matrix of the current model.

this is usually for getting the mount point on a certain model, such as horses. It also works for static mesh with xrefed mountable objects.

Parameters
pOutoutput result
nAttachmentIDsee ATTACHMENT_ID. default to 0, which is general mount point. ATT_ID_MOUNT1-9(20-28) is another mount points
nRenderNumberif it is bigger than current calculated render number, the value will be recalculated. If 0, it will not recalculate
Returns
: NULL if not attachment found, otherwise it is pOut.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, ParaEngine::CMeshObject, ParaEngine::CLightObject, and ParaEngine::BMaxObject.

§ GetAttachmentPosition()

Vector3 * CBaseObject::GetAttachmentPosition ( Vector3 pOut,
int  nAttachmentID = 0,
int  nRenderNumber = 0 
)
virtual

whether it has an attachment point

Parameters
pOutin world coordinate
nAttachmentIDsee ATTACHMENT_ID. default to 0, which is general mount point. ATT_ID_MOUNT1-9(20-28) is another mount points
nRenderNumberif it is bigger than current calculated render number, the value will be recalculated. If 0, it will not recalculate
Returns
if it does not exist, NULL is returned.

§ GetAttributeClassID()

virtual int ParaEngine::CBaseObject::GetAttributeClassID ( )
inlinevirtual

§ GetBipedStateManager()

virtual CBipedStateManager* ParaEngine::CBaseObject::GetBipedStateManager ( bool  bCreateOnDemand = true)
inlinevirtual

get biped state manager

Parameters
bCreateOnDemandif true, we will attempt to create the manager if it is not created before.
Returns
it may return NULL if bCreateOnDemand is false.

Reimplemented in ParaEngine::CBipedObject.

§ GetBoundingBox()

void CBaseObject::GetBoundingBox ( float *  fOBB_X,
float *  fOBB_Y,
float *  fOBB_Z,
float *  fFacing 
)
virtual

§ GetBoundRect()

void CBaseObject::GetBoundRect ( float *  fWidth,
float *  fHeight,
float *  fFacing 
)
virtual

§ GetChildAttributeColumnCount()

int CBaseObject::GetChildAttributeColumnCount ( )
virtual

we support multi-dimensional child object.

by default objects have only one column.

Reimplemented from ParaEngine::IAttributeFields.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CSceneObject, ParaEngine::BMaxObject, and ParaEngine::COverlayObject.

§ GetChildAttributeObject()

IAttributeFields * CBaseObject::GetChildAttributeObject ( const std::string &  sName)
virtual

get attribute by child object.

used to iterate across the attribute field hierarchy.

Reimplemented from ParaEngine::IAttributeFields.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CSceneObject, and ParaEngine::COverlayObject.

§ GetChildAttributeObjectCount()

int CBaseObject::GetChildAttributeObjectCount ( int  nColumnIndex = 0)
virtual

get the number of child objects (row count) in the given column.

please note different columns can have different row count.

Reimplemented from ParaEngine::IAttributeFields.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CSceneObject, ParaEngine::BMaxObject, and ParaEngine::COverlayObject.

§ GetChildByName()

CBaseObject * CBaseObject::GetChildByName ( const string &  name,
bool  bRecursive = false 
)

get child by name: it may return NULL if the child does not exist.

Parameters
bRecursiveif true, it will be recursive (depth first search), otherwise only the direct children is searched.

§ GetCtorPercentage()

virtual float ParaEngine::CBaseObject::GetCtorPercentage ( )
inlinevirtual

Get the object construction percentage (progress) in the range[0,1].

0 means that the object has not been constructed. 1 means that the object is fully constructed. This value can be used to inform user that how much an object has been loaded.

Reimplemented in ParaEngine::CMeshPhysicsObject, and ParaEngine::CMeshObject.

§ GetDefaultReplaceableTexture()

TextureEntity * CBaseObject::GetDefaultReplaceableTexture ( int  ReplaceableTextureID)
virtual

get the default replaceable texture by its ID.

The default replaceable texture is the main texture exported from the 3dsmax exporter.

Parameters
ReplaceableTextureIDusually [0-32) generally speaking, replaceable ID 0 is used for general purpose replaceable texture, ID 1 is for user defined. ID 2 is for custom skins.
Returns
this may return NULL, if replaceable texture is not set before or ID is invalid.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, and ParaEngine::CMeshObject.

§ GetEffectParamBlock()

CParameterBlock * CBaseObject::GetEffectParamBlock ( bool  bCreateIfNotExist = false)
virtual

get effect parameter block with this object.

Parameters
bCreateIfNotExist

Reimplemented in ParaEngine::CMeshPhysicsObject.

§ GetFrameNumber()

int CBaseObject::GetFrameNumber ( )

get the frame number that this object is last accessed.

§ GetHomeZone()

CZoneNode * CBaseObject::GetHomeZone ( )

get the home zone of this object if any.

it may return NULL, if zone is not visible.

§ GetID()

int CBaseObject::GetID ( )

the ID of the object.

The ID of the object is only generated when the first time this function is called. One can then easily get the object, by calling GetObjectByID. When an object is released, its ID is not longer used. Please note that the ID is neither unique outside the world, nor persistent in the same world.

§ GetNumReplaceableTextures()

int CBaseObject::GetNumReplaceableTextures ( )
virtual

get the total number of replaceable textures, which is the largest replaceable texture ID.

but it does not mean that all ID contains valid replaceable textures. This function can be used to quickly decide whether the model contains replaceable textures. Generally we allow 32 replaceable textures per model.

Returns
0 may be returned if no replaceable texture is used by the model.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, ParaEngine::CMeshObject, and ParaEngine::CVoxelMesh.

§ GetObjectByID()

CBaseObject * CBaseObject::GetObjectByID ( int  nID)
static

GetObject By ID.

it does not matter whether this object is attached or not. It will return NULL, if not found

§ GetPhysicsGroup()

virtual int ParaEngine::CBaseObject::GetPhysicsGroup ( )
inlinevirtual

Get the physics group ID to which this object belongs to default to 0, must be smaller than 32.

please see groups Mask used to filter shape objects. See #NxShape::setGroup

  • group 0 means physics object that will block the camera and player, such as building walls, big tree trunks, etc.
  • group 1 means physics object that will block the player and standard mouse picking, but not the camera, such as small stones, thin posts, trees, etc.
  • group 2 means physics object that will block the player, but not the camera or mouse picking, such as transparent wall to prevent user to walk on.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, and ParaEngine::BMaxObject.

§ GetPhysicsRadius()

float CBaseObject::GetPhysicsRadius ( )
virtual

get the radius for physics simulation.

Reimplemented in ParaEngine::CBipedObject.

§ GetPrimaryAsset()

virtual AssetEntity* ParaEngine::CBaseObject::GetPrimaryAsset ( )
inlinevirtual

Set scaling.

By default an object will be first scaled, then rotated and finally translated. Not many objects support scaling. Only the mesh and mesh physics object supports full-dimensional object positioning. I.e. rotation, norm, position, scaling. used as KEY for batch rendering

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, ParaEngine::CMeshObject, ParaEngine::CSpriteObject, ParaEngine::CRenderTarget, ParaEngine::CLightObject, ParaEngine::CMissileObject, ParaEngine::CVoxelMesh, and ParaEngine::BMaxObject.

§ GetPrimaryTechniqueHandle()

int CBaseObject::GetPrimaryTechniqueHandle ( )
virtual

when batch-rendering a group of objects, objects are usually sorted by their render techniques and then by their primary asset.

One can access the effect file currently associated with the handle in the asset manager. Please note that, the game engine may change the mapping from technique handle to the effect file, secretly at runtime. Effect files capable to be assigned to the same technique handle must also share the same (vertex) input declaration in order to be swapped secretly at runtime. Note: the Draw() function of object will dynamically retrieve the effect file for each call. If the effect file is not valid, it will try to render using directx 9's fixed programming pipeline.

See also
TechniqueHandle

Reimplemented in ParaEngine::CMeshPhysicsObject.

§ GetRadius()

float CBaseObject::GetRadius ( )
virtual

§ GetRenderDistance()

float CBaseObject::GetRenderDistance ( )
virtual

we will not render this object if the object's position to camera eye position is further than this value.

If this is 0 of negative, the global view clipping rule is applied.

§ GetRenderOrder()

float ParaEngine::CBaseObject::GetRenderOrder ( ) const
inline

0 if automatic, larger number renders after smaller numbered object.

The following numbers are fixed in the pipeline and may subject to changes in later versions. [1.0-2.0): solid big objects [2.0-3.0): solid small objects [3.0-3.0): sprites [4.0-4.0): characters [5.0-5.0): selection [6.0-7.0): transparent object [100.0, ...): rendered last and sorted by m_fRenderOrder

§ GetReplaceableTexture()

TextureEntity * CBaseObject::GetReplaceableTexture ( int  ReplaceableTextureID)
virtual

get the current replaceable texture by its ID.

if no replaceable textures is set before, this will return the same result as GetNumReplaceableTextures().

Note
: This function will cause the mesh entity to be initialized.
Parameters
ReplaceableTextureIDusually [0-32) generally speaking, replaceable ID 0 is used for general purpose replaceable texture, ID 1 is for user defined. ID 2 is for custom skins.
Returns
this may return NULL, if replaceable texture is not set before or ID is invalid.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, ParaEngine::CMeshObject, ParaEngine::BMaxObject, and ParaEngine::CVoxelMesh.

§ GetSelectGroupIndex()

int CBaseObject::GetSelectGroupIndex ( )

get the selection group index.

if -1, it means that it was not selected.

§ GetSelectionEffect()

int CBaseObject::GetSelectionEffect ( )
virtual

get the render effect when character is in selected state.

Returns
: 1 for yellow border style, 0 for unlit style. default to 0.

§ GetTileContainer()

CTerrainTile * CBaseObject::GetTileContainer ( )

get the quad-tree terrain tile that this game object is currently visiting.

§ HasAlphaBlendedObjects()

bool CBaseObject::HasAlphaBlendedObjects ( )
virtual

return true if the object contains alpha blended render pass.

This function determines which render pipeline stage the object is rendered. generally speaking, if deferred shading is used, we will render alpha blended objects last.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, and ParaEngine::CMeshObject.

§ HasAttachmentPoint()

bool CBaseObject::HasAttachmentPoint ( int  nAttachmentID = 0)
virtual

whether it has an attachment point

Parameters
nAttachmentIDsee ATTACHMENT_ID. default to 0, which is general mount point. ATT_ID_MOUNT1-9(20-28) is another mount points

Reimplemented in ParaEngine::CBipedObject, and ParaEngine::CMeshPhysicsObject.

§ InstallFields()

int CBaseObject::InstallFields ( CAttributeClass pClass,
bool  bOverride 
)
virtual

§ IsBillboarded()

bool ParaEngine::CBaseObject::IsBillboarded ( )
inline

if the model asset file name ended with "_b" it will be treated as billboarded.

all billboarded mesh are not physical mesh.

Returns
true if billboarded.

§ IsDead()

bool CBaseObject::IsDead ( )
virtual

whether this object should be removed some time in the future.

we usually call AddToDeadObjectPool(), and let the root scene to remove it safely in the next render frame move. After all, it is up to the individual class to decide which action to take when setting dead. For example, some implementation may remove it during prepare render.

Reimplemented in ParaEngine::CRenderTarget, and ParaEngine::CBlockDynamicObject.

§ IsGeometryDirty()

bool ParaEngine::CBaseObject::IsGeometryDirty ( ) const
inline

whether the shape of the object is dirty, such as model, size, facing, local transform is changed.

§ IsGlobal()

bool CBaseObject::IsGlobal ( )
virtual

whether this object is global.

By default,the type info is used to determine this.

Reimplemented in ParaEngine::IGameObject.

§ IsLastFrameRendered()

bool CBaseObject::IsLastFrameRendered ( )

check to see if the last frame is rendered.

Internally it will check if FrameNumber of this object and the main scene are equal.

§ IsLODEnabled()

bool CBaseObject::IsLODEnabled ( ) const

whether to enable lod if there is lod.

Default to true.

§ IsPersistent()

bool CBaseObject::IsPersistent ( )
virtual

whether the object is persistent in the world.

If an object is persistent, it will be saved to the world's database. if it is not persistent it will not be saved when the world closes. Player, OPC, some temporary movie actors may by non-persistent; whereas NPC are usually persistent to the world that it belongs.

Reimplemented in ParaEngine::CSceneObject, ParaEngine::IGameObject, ParaEngine::CMeshPhysicsObject, and ParaEngine::CMeshObject.

§ IsRenderable()

bool ParaEngine::CBaseObject::IsRenderable ( )
inline

whether this object can be rendered.

It should be both visible and no skip render.

§ IsShadowCaster()

bool ParaEngine::CBaseObject::IsShadowCaster ( )
inline
Returns
true if it is shadow caster. default value is true.

§ IsShadowReceiver()

bool ParaEngine::CBaseObject::IsShadowReceiver ( )
inline

if the model asset file name ended with "_r" it will be treated as shadow receiver.

Returns
true if it is shadow receiver

§ IsSkipPicking()

bool ParaEngine::CBaseObject::IsSkipPicking ( )
inline

get whether object should be excluded from picking.

§ IsSkipRender()

bool ParaEngine::CBaseObject::IsSkipRender ( )
inline

get whether object should be excluded from the render queue.

§ IsSkipTerrainNormal()

bool CBaseObject::IsSkipTerrainNormal ( )

if specified, this character will always be perpendicular to the ground, regardless to the terrain normal.

this is usually true for tall thin biped players.

§ IsTransparent()

virtual bool ParaEngine::CBaseObject::IsTransparent ( )
inlinevirtual

whether the object contains transparent material.

Ideally, we should perform polygon-level sorting for transparent faces; however, at the moment, we just draw them last, after all solid objects are drawn.

Returns
true if it is partially or completely transparent.

Reimplemented in ParaEngine::CMeshPhysicsObject, ParaEngine::CMeshObject, and ParaEngine::CadModelNode.

§ IsUseGlobalTime()

virtual bool ParaEngine::CBaseObject::IsUseGlobalTime ( )
inlinevirtual

whether to use global time to sync animation.

Default to false. if true, all characters plays exactly the same frames if they are using the same animation file at all times, if false, each character advances its time frame separately according to their visibility in the scene.

Note
: animation is always looped once use global time

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, and ParaEngine::CMeshObject.

§ IsVisible()

bool CBaseObject::IsVisible ( )

invisible object will not be drawn.

e.g. one can turn off the visibility of physics object.

§ OnDeSelect()

void CBaseObject::OnDeSelect ( )
virtual

called whenever an object is un-selected.

Reimplemented in ParaEngine::CMeshPhysicsObject.

§ OnSelect()

void CBaseObject::OnSelect ( int  nGroupID)
virtual

called when an object is selected.

Parameters
nGroupIDthe group ID in to which the object is selected.

object selection technique

Reimplemented in ParaEngine::CMeshPhysicsObject.

§ PopParam()

void CBaseObject::PopParam ( )
virtual

Usually, this is used in canvas drawing.

So that the same object can be used in different scene manager. Parameter includes: position, facing, facing target, speed, etc.

Note
: must be paired with PushParam(). currently, it does not use a stack for storing parameters, but a simple set of globals. So only one level push/pop operation is supported.

Reimplemented in ParaEngine::CBipedObject.

§ PrepareRender()

int CBaseObject::PrepareRender ( CBaseCamera pCamera,
SceneState sceneState 
)
virtual

derived class can override this function to place the object in to the render pipeline.

if this function return -1 by default, the SceneObject will automatically place the object into the render pipeline. if return 0, it means the object has already placed the object and the scene object should skip this object.

Reimplemented in ParaEngine::CMiniSceneGraph, ParaEngine::CLightObject, ParaEngine::CWeatherEffect, ParaEngine::CRenderTarget, ParaEngine::CBlockPieceParticle, ParaEngine::COverlayObject, and ParaEngine::CContainerObject.

§ PushParam()

void CBaseObject::PushParam ( )
virtual

Usually, this is used in canvas drawing.

So that the same object can be used in different scene manager. Parameter includes: position, facing, facing target, speed, etc.

Note
: must be paired with PopParam(). currently, it does not use a stack for storing parameters, but a simple set of globals. So only one level push/pop operation is supported.

Reimplemented in ParaEngine::CBipedObject.

§ QueryIGameObject()

IGameObject * CBaseObject::QueryIGameObject ( )
virtual

this may return NULL, if the object does not implement the IGameObject interface.

Reimplemented in ParaEngine::CBipedObject.

§ QueryObject()

void * CBaseObject::QueryObject ( int  nObjectType)
virtual

convert to object of a given type.

Parameters
nObjectTypesuch as values in ATTRIBUTE_CLASSID_TABLE

Reimplemented from ParaEngine::IAttributeFields.

§ QueryObjectByName()

void * CBaseObject::QueryObjectByName ( const std::string &  sObjectType)
virtual

convert to object of a given type.

Parameters
sObjectType

Reimplemented from ParaEngine::IAttributeFields.

§ RemoveChild()

int CBaseObject::RemoveChild ( const CBaseObject pObj,
bool  bRecursive = false 
)

remove a child by pointer but it does not destroy it.

It returns the number of nodes that are removed. the current version will only remove the first child with the given name.

§ RemoveChildByName()

int CBaseObject::RemoveChildByName ( const string &  name,
bool  bRecursive = false 
)

remove a child by name but it does not destroy it.

It returns the number of nodes that are removed. the current version will only remove the first child with the given name.

§ Reset()

virtual void ParaEngine::CBaseObject::Reset ( )
inlinevirtual

§ SetAlwaysLoadPhysics()

void CBaseObject::SetAlwaysLoadPhysics ( bool  bEnable)
virtual

by default physics is lazy-load when player walk into its bounding box, setting this to false will always load the physics.

Please note, one must EnablePhysics(true) before this one takes effect.

Reimplemented in ParaEngine::CMeshPhysicsObject, and ParaEngine::BMaxObject.

§ SetAnimation()

virtual void ParaEngine::CBaseObject::SetAnimation ( int  nAnimID)
inlinevirtual

Set the current animation id.

Parameters
nAnimID0 is default standing animation. 4 is walking, 5 is running. more information, please see AnimationID

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, and ParaEngine::CMeshObject.

§ SetAnimFrame()

virtual void ParaEngine::CBaseObject::SetAnimFrame ( int  nFrame)
inlinevirtual

set the current animation frame number relative to the beginning of current animation.

Parameters
nFrame0 means beginning. if nFrame is longer than the current animation length, it will wrap (modulate the length).

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, ParaEngine::BMaxObject, and ParaEngine::CMeshObject.

§ SetAttribute()

void ParaEngine::CBaseObject::SetAttribute ( DWORD  dwAtt,
bool  bTurnOn = true 
)
inline

enable or disable a given attribute.

Parameters
dwAtt
bTurnOntrue to turn on, false to turn off.

§ SetBillboarded()

void ParaEngine::CBaseObject::SetBillboarded ( bool  bBillboarded)
inline
Parameters
bBillboardedif true it will be billboarded. default value is false.

§ SetBoundingBox()

void CBaseObject::SetBoundingBox ( float  fOBB_X,
float  fOBB_Y,
float  fOBB_Z,
float  fFacing 
)
virtual

Set the object shape to box and bounding box parameters if fFacing is 0, it is a axis aligned bounding box (AABB).

The bounding sphere is set to radius of bounding box's the smallest spherical container

Parameters
fOBB_Xobject bounding box.x
fOBB_Yobject bounding box.y
fOBB_Zobject bounding box.z
fFacingrotation of the bounding box around the y axis.

Reimplemented from ParaEngine::IViewClippingObject.

Reimplemented in ParaEngine::CMeshPhysicsObject, and ParaEngine::CTileObject.

§ SetBoundRect()

void CBaseObject::SetBoundRect ( float  fWidth,
float  fHeight,
float  fFacing 
)
virtual

Set the object shape to rect (a plane) and rect parameters if fFacing is 0, it is a axis aligned bounding box (AABB).

Parameters
fWidthplane width or x
fHeightplane height or y.
fFacingrotation of the plane around the y axis.

Reimplemented from ParaEngine::IViewClippingObject.

Reimplemented in ParaEngine::CMeshPhysicsObject, and ParaEngine::CTileObject.

§ SetCtorPercentage()

virtual void ParaEngine::CBaseObject::SetCtorPercentage ( float  fPercentage)
inlinevirtual

Set the object construction percentage (progress) in the range[0,1].

0 means that the object has not been constructed. 1 means that the object is fully constructed. This value can be used to inform user that how much an object has been loaded.

Reimplemented in ParaEngine::CMeshPhysicsObject, and ParaEngine::CMeshObject.

§ SetHomeZone()

void CBaseObject::SetHomeZone ( CZoneNode pZone)

set the home zone of this object if any.

it may return NULL, if zone is not visible.

Parameters
pZoneif this is NULL, it will remove the zone.

§ SetHomeZoneName()

void CBaseObject::SetHomeZoneName ( const char *  sName)

set the home zone name.

if the zone does not exist, it will be created.

§ SetMyType()

void CBaseObject::SetMyType ( ObjectType  t)

set the type of the object, it tells what this object is used for.

it will automatically set its volume field according to its type.

§ SetOnAssetLoaded()

void CBaseObject::SetOnAssetLoaded ( const char *  sCallbackScript)
virtual

set the callback script whenever the primary asset is successfully loaded.

Reimplemented in ParaEngine::CBipedObject, and ParaEngine::CMeshPhysicsObject.

§ SetParent()

virtual void ParaEngine::CBaseObject::SetParent ( CBaseObject pParent)
inlinevirtual

this function is called by parent class to set the child's parent.

in most cases, the child does not need to save parent, but some child class can override this function to keep a weak reference of parent.

Reimplemented in ParaEngine::CBlockDynamicObject, and ParaEngine::CGeosetObject.

§ SetPersistent()

void CBaseObject::SetPersistent ( bool  bPersistent)
virtual

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.

so special caution must be given when using this function to prevent accidentally losing information.

See also
IsPersistent()

Reimplemented in ParaEngine::CSceneObject, ParaEngine::IGameObject, ParaEngine::CMeshPhysicsObject, and ParaEngine::CMeshObject.

§ SetPhysicsGroup()

virtual void ParaEngine::CBaseObject::SetPhysicsGroup ( int  nGroup)
inlinevirtual

set the physics group ID to which this object belongs to default to 0, must be smaller than 32.

please see groups Mask used to filter shape objects. See #NxShape::setGroup

  • group 0 means physics object that will block the camera and player, such as building walls, big tree trunks, etc.
  • group 1 means physics object that will block the player, but not the camera, such as small stones, thin posts, trees, etc.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::BMaxObject, and ParaEngine::CMeshPhysicsObject.

§ SetPrimaryTechniqueHandle()

void CBaseObject::SetPrimaryTechniqueHandle ( int  nHandle)
virtual

Set a new render technique handle.

If the effect file associated with the handle is invalid or do not share the same input declaration as the object at the time of drawing, the object will not be drawn or will be drawn improperly. This function rarely needs to be called by users. Technique handles are usually automatically assigned by the game engine when the asset file is loaded. Of course, users can use special effect files for the rendering of special objects; then this function needs to be called.

Parameters
nHandle
See also
TechniqueHandle

Reimplemented in ParaEngine::CBipedObject, and ParaEngine::CMeshPhysicsObject.

§ SetRadius()

void CBaseObject::SetRadius ( float  fRadius)
virtual

Set the object shape to Sphere and sphere parameters.

Parameters
fRadiusradius

Reimplemented from ParaEngine::IViewClippingObject.

Reimplemented in ParaEngine::CMeshPhysicsObject, ParaEngine::CSphereObject, and ParaEngine::CTileObject.

§ SetRenderImportance()

void ParaEngine::CBaseObject::SetRenderImportance ( int  nRenderImportance)
inline

the larger, the more important.

default to 0. all objects with 0 or positive number will always be rendered. objects with negative numbers will not be rendered if there are too many objects in the scene.

Parameters
nRenderImportancefor example,we can set player to 2, NPC to 1, friend OPC to -1, non-friend OPC to -2, etc

§ SetReplaceableTexture()

bool CBaseObject::SetReplaceableTexture ( int  ReplaceableTextureID,
TextureEntity pTextureEntity 
)
virtual

set the replaceable texture at the given index with a new texture.

this function will succeed regardless whether the mesh is initialized. Hence it can be used at loading time. because default instance of the mesh may use different replaceable texture set.

Parameters
ReplaceableTextureIDusually [0-32) generally speaking, replaceable ID 0 is used for general purpose replaceable texture, ID 1 is for user defined. ID 2 is for custom skins.
pTextureEntityThe reference account of the texture entity will be automatically increased by one.
Returns
true if succeed. if ReplaceableTextureID exceed the total number of replaceable textures, this function will return false.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, ParaEngine::CMeshObject, ParaEngine::CVoxelMesh, and ParaEngine::BMaxObject.

§ SetSelectGroupIndex()

void CBaseObject::SetSelectGroupIndex ( int  nGroupIndex = -1)

set the selection group index.

if -1, it means that it was not selected.

Parameters
nGroupIndexselection group index.

§ SetSelectionEffect()

void CBaseObject::SetSelectionEffect ( int  nStyle)
virtual

get the render effect when character is in selected state.

Parameters
nStyle1 for yellow border style, 0 for unlit style. default to 0.

§ SetShadowCaster()

void ParaEngine::CBaseObject::SetShadowCaster ( bool  bEnable)
inline

set whether it is shadow caster.

default value is true. if the model asset file name ended with "_e" it will be treated as not a shadow caster.

§ SetShadowReceiver()

void ParaEngine::CBaseObject::SetShadowReceiver ( bool  bEnable)
inline
Parameters
trueit is shadow caster. default value is false.

§ SetSkipTerrainNormal()

void CBaseObject::SetSkipTerrainNormal ( bool  bSkip)

if specified, this character will always be perpendicular to the ground, regardless to the terrain normal.

this is usually true for tall thin biped players.

§ SetTransparent()

virtual void ParaEngine::CBaseObject::SetTransparent ( bool  bIsTransparent)
inlinevirtual

Set whether the object is transparent.

Parameters
bIsTransparent

Reimplemented in ParaEngine::CMeshPhysicsObject, ParaEngine::CMeshObject, and ParaEngine::CadModelNode.

§ SetUseGlobalTime()

virtual void ParaEngine::CBaseObject::SetUseGlobalTime ( bool  bUseGlobalTime)
inlinevirtual

whether to use global time to sync animation.

Default to false. if true, all characters plays exactly the same frames if they are using the same animation file at all times, if false, each character advances its time frame separately according to their visibility in the scene.

Note
: animation is always looped once use global time

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, and ParaEngine::CMeshObject.

§ SetVisibility()

void CBaseObject::SetVisibility ( bool  bVisible)

set the visibility of this object.

The visibility will recursively affect all its child objects.

§ SnapToTerrainSurface()

void CBaseObject::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.

if bUseNorm is true, the norm value is also changed.

set the norm of the object to the terrain surface norm.

set the position.y to the height of the terrain at that point

§ ToString()

std::string CBaseObject::ToString ( DWORD  nMethod)
virtual

convert the object to an NPL string by which this object may be created or deleted.

Parameters
nMethodbit combination of CBaseObject::NPL_STRING

just a comment line with its name.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CLightObject, ParaEngine::CZoneNode, ParaEngine::CPortalNode, and ParaEngine::CMeshPhysicsObject.

§ UpdateFrameNumber()

void CBaseObject::UpdateFrameNumber ( int  nFrameNumber)
virtual

this function is called to update the render frame number of this object.

please note that, the frame number increases by 1 every frame. This function is called at the earliest scene culling stage. the object may be culled in later rendering stages. so one should not do much computation in this place. in most cases, we only need to cache some derived data such as render coordinates for use in later rendering processes.

Reimplemented in ParaEngine::CPortalNode.

§ UpdateGeometry()

void CBaseObject::UpdateGeometry ( )
virtual

this function is usually called after asset file has changed.

and bounding box needs to be recalculated.

Reimplemented in ParaEngine::CBipedObject, and ParaEngine::BMaxObject.

§ UpdateTileContainer()

void CBaseObject::UpdateTileContainer ( )
virtual

update the tile container according to the current position of the game object.

This function is automatically called when a global object is attached.

Reimplemented in ParaEngine::IGameObject.

§ ViewTouch()

bool CBaseObject::ViewTouch ( )
virtual

this function is called, when the object is in view range.

we may need to load the primary asset to update the bounding box, etc.

Returns
true if the object is ready to be rendered.

Reimplemented in ParaEngine::CBipedObject, ParaEngine::CMeshPhysicsObject, ParaEngine::CMeshObject, and ParaEngine::CadModelNode.

Member Data Documentation

§ g_nObjectSelectionEffect

int CBaseObject::g_nObjectSelectionEffect = ParaEngine::RenderSelectionStyle_border
staticprotected

enum of RenderSelectionStyle

default selection style.

§ m_bEnableLOD

bool ParaEngine::CBaseObject::m_bEnableLOD
protected

whether to enable lod if there is lod.

Default to true.

§ m_bGeometryDirty

bool ParaEngine::CBaseObject::m_bGeometryDirty
protected

whether the shape of the object is dirty, such as model, size, facing, local transform is changed.

§ m_dwAttribute

DWORD ParaEngine::CBaseObject::m_dwAttribute
protected

volume type and attribute of this object.

See also
OBJECT_ATTRIBUTE

§ m_fRenderDistance

float ParaEngine::CBaseObject::m_fRenderDistance
protected

we will not render this object if the object's position to camera eye position is further than this value.

If this is 0 of negative, the global view clipping rule is applied. default to 0.f

§ m_fRenderOrder

float ParaEngine::CBaseObject::m_fRenderOrder
protected

0 if automatic, larger number renders after smaller numbered object.

The following numbers are fixed in the pipeline and may subject to changes in later versions. [1.0-2.0): solid big objects [2.0-3.0): solid small objects [3.0-3.0): sprites [4.0-4.0): characters [5.0-5.0): selection [6.0-7.0): transparent object [100.0, ...): rendered last and sorted by m_fRenderOrder

§ m_nFrameNumber

int32 ParaEngine::CBaseObject::m_nFrameNumber
protected

the frame number that this object is last accessed.

§ m_nID

int ParaEngine::CBaseObject::m_nID
protected

the ID of the object.

default to 0. it is regenerated automatically when GetID() is called and that the id is 0.

§ m_nRenderImportance

int32 ParaEngine::CBaseObject::m_nRenderImportance
protected

the larger, the more important.

default to 0. only positive numbers are allowed. During scene sorting, objects of the same group with larger render importance is rendered first, regardless of its camera to object distance we can limit the max number of objects drawn of a given render importance by calling SceneObject::SetMaxRenderCount() function

§ m_nSelectGroupIndex

int32 ParaEngine::CBaseObject::m_nSelectGroupIndex
protected

this is the selection group index.

if -1, it means that it was not selected.


The documentation for this class was generated from the following files: