My Project
|
The top level scene management class. More...
#include <SceneObject.h>
Public Types | |
enum | OBJECT_LEVEL_CULLING_METHOD { CENTER_ON_CAMERA = 1, CENTER_ON_PLAYER = 0x1<<1, CENTER_ON_FRUSTUM = 0x1<<2, VIEW_RADIUS_FOG = 0x1<<3, VIEW_RADIUS_FRUSTUM = 0x1<<4 } |
a bit wise field for object level culling parameters. More... | |
typedef unordered_ref_array< CAutoCamera * > | CameraPool_type |
typedef unordered_ref_array< CMiniSceneGraph * > | MiniSceneGraphPool_type |
typedef unordered_ref_array< CSkyMesh * > | SkyMeshPool_type |
typedef std::list< ShadowVolume * > | ShadowVolumePool_Type |
typedef unordered_ref_array< CMissileObject * > | MissileObjectPool_Type |
![]() | |
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 | |
CSceneObject () | |
virtual CBaseObject::_SceneObjectType | GetType () |
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 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) |
ATTRIBUTE_METHOD1 (CSceneObject, IsModified_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetModified_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsUsingFullScreenGlow_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, EnableFullScreenGlow_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetFullscreenGlowIntensity_s, float *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetFullscreenGlowIntensity_s, float) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetFullscreenGlowBlendingFactor_s, float *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetFullscreenGlowBlendingFactor_s, float) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetGlowness_s, Vector4 *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetGlowness_s, Vector4) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsSunLightEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, EnableSunLight_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsLightEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, EnableLight_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsShowLocalLightMesh_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, ShowLocalLightMesh_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetMaxLocalLightsNum_s, int *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetMaxLocalLightsNum_s, int) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsShadowMapEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetShadow_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetMaximumNumShadowCasters_s, int *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetMaximumNumShadowCasters_s, int) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetMaximumNumShadowReceivers_s, int *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetMaximumNumShadowReceivers_s, int) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetMaxCharTriangles_s, int *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetMaxCharTriangles_s, int) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetBackGroundColor_s, Vector3 *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetBackGroundColor_s, Vector3) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsFogEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, EnableFog_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetFogColor_s, Vector3 *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetFogColor_s, Vector3) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetFogStart_s, float *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetFogStart_s, float) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetFogEnd_s, float *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetFogEnd_s, float) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetFogDensity_s, float *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetFogDensity_s, float) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetMinPopUpDistance_s, float *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetMinPopUpDistance_s, float) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetOnClickDistance_s, float *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetOnClickDistance_s, float) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsRenderSky_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, EnableSkyRendering_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsScenePaused_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, PauseScene_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsSceneEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, EnableScene_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsShowBoundingBox_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, ShowBoundingBox_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsGenerateReport_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetGenerateReport_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsPortalSystemShown_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, ShowPortalSystem_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsAutoPlayerRippleEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, EnableAutoPlayerRipple_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsHeadOnDisplayShown_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, ShowHeadOnDisplay_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsPortalZoneEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, EnablePortalZone_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsUseWireFrame_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetUseWireFrame_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsForceExportPhysics_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetForceExportPhysics_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsInstancingEnabled_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, EnableInstancing_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetMaxHeadOnDisplayDistance_s, float *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetMaxHeadOnDisplayDistance_s, float) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsPersistent_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetPersistent_s, bool) | |
ATTRIBUTE_METHOD (CSceneObject, ScreenShotReflection_s) | |
ATTRIBUTE_METHOD (CSceneObject, ScreenShotShadowMap_s) | |
ATTRIBUTE_METHOD (CSceneObject, ScreenShotGlowMap_s) | |
ATTRIBUTE_METHOD (CSceneObject, ClearParticles_s) | |
ATTRIBUTE_METHOD (CSceneObject, UnLoadFlashTextures_s) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetPhysicsDebugDrawMode_s, int *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetPhysicsDebugDrawMode_s, int) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsBlockInput_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetBlockInput_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetAllMiniSceneGraphNames_s, const char **) | |
ATTRIBUTE_METHOD1 (CSceneObject, GetShadowRadius_s, float *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetShadowRadius_s, float) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsDropShadow_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetDropShadow_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsUsingScreenWaveEffect_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetEnableScreenWaveEffect_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, IsShowMainPlayer_s, bool *) | |
ATTRIBUTE_METHOD1 (CSceneObject, ShowMainPlayer_s, bool) | |
ATTRIBUTE_METHOD1 (CSceneObject, SetShadowMapTexelSize_s, int) | |
void | ShowHeadOnDisplay (bool bShow) |
show or hide all scene's objects' head on display | |
bool | IsHeadOnDisplayShown () |
whether all scene's objects' head on display | |
void | SetMaxHeadOnDisplayDistance (float fDist) |
show or hide all scene's objects' head on display | |
float | GetMaxHeadOnDisplayDistance () |
whether all scene's objects' head on display | |
bool | ScreenShotReflection () |
take a screen shot of the current reflection map and save it to . More... | |
bool | ScreenShotShadowMap () |
take a screen shot of the current shadow map and save it to . More... | |
bool | ScreenShotGlowMap () |
take a screen shot of the current glow texture and save it to . More... | |
bool | UnLoadFlashTextures () |
unload all flash textures. More... | |
void | ClearParticles () |
clear all particles. More... | |
void | SetForceExportPhysics (bool bWhetherPhysicsAreAlwaysExported) |
set whether physics of MeshPhysicsObject is always exported regardless of per object settings. More... | |
bool | IsForceExportPhysics () |
get whether physics of MeshPhysicsObject is always exported regardless of per object settings. More... | |
float | GetMinPopUpDistance () |
all objects must be drawn when they are within this radius. More... | |
void | SetMinPopUpDistance (float fDist) |
bool | IsSnapToTerrain () |
whether snap to terrain | |
bool | IsShowBoundingBox () |
whether to draw bounding box of scene objects. More... | |
void | ShowBoundingBox (bool bEnable) |
bool | IsGenerateReport () |
whether to use generate scene report. More... | |
void | SetGenerateReport (bool bEnable) |
bool | IsOcclusionQueryEnabled () |
whether to use occlusion query algorithm for rendering. More... | |
void | EnableOcclusionQuery (bool bEnable) |
bool | IsInstancingEnabled () |
whether to use instancing. More... | |
void | EnableInstancing (bool bEnable) |
bool | IsShowMainPlayer () |
whether to show main player. More... | |
void | ShowMainPlayer (bool bEnable) |
bool | CanShowMainPlayer () const |
whether current camera allows showing the main player | |
void | SetCanShowMainPlayer (bool val) |
bool | IsScenePaused () |
when a scene is paused, all animation will be frozen. More... | |
void | PauseScene (bool bEnable) |
bool | IsSceneEnabled () |
whether 3D scene is enabled or not. More... | |
void | EnableScene (bool bEnable) |
void | SetModified (bool bModified) |
set whether scene is modified | |
bool | IsModified () |
Get whether scene is modified. | |
bool | IsSunLightEnabled () |
get light enable state | |
void | EnableSunLight (bool bEnable) |
whether use light | |
bool | IsLightEnabled () |
get light enable state | |
void | EnableLight (bool bEnable) |
whether use light | |
void | SetMaxLocalLightsNum (int nNum) |
set maximum number of local lights per object. More... | |
int | GetMaxLocalLightsNum () |
get maximum number of local lights per object. More... | |
bool | IsShowLocalLightMesh () |
whether show the arrow mesh associated with the light object. More... | |
void | ShowLocalLightMesh (bool bShow) |
show the arrow mesh associated with the light object | |
bool | IsRenderSky () |
whether rendering the sky | |
void | EnableSkyRendering (bool bEnable) |
void | SetBackGroundColor (const LinearColor &bgColor) |
set the color of the scene ground when it is not enabled.When scene is enabled, the background color is always the fog color. More... | |
LinearColor | GetBackGroundColor () |
Get the color of the scene ground when it is not enabled.When scene is enabled, the background color is always the fog color. More... | |
LinearColor | GetClearColor () |
Get the color of the scene ground when it is not enabled.When scene is enabled, the background color is always the fog color. More... | |
void | SetFogColorFactor (const LinearColor &fogColorFactor) |
fog parameters | |
const LinearColor & | GetFogColorFactor () |
void | SetFogColor (const LinearColor &fogColor) |
LinearColor | GetFogColor () |
void | SetFogStart (float fFogStart) |
float | GetFogStart () |
void | SetFogEnd (float fFogEnd) |
float | GetFogEnd () |
void | SetFogDensity (float fFogDensity) |
float | GetFogDensity () |
void | EnableFog (bool bEnableFog) |
bool | IsFogEnabled () |
void | ResetCameraAndFog () |
void | SetAndRestoreFog (bool bEnableFog, DWORD dwFogColor, FLOAT fFogStart, FLOAT fFogEnd, FLOAT fFogDensity) |
void | SetShadow (bool bRenderShadow) |
whether render shadow More... | |
bool | IsShadowMapEnabled () |
whether render using shadow map | |
int | GetMaximumNumShadowCasters () |
get the maximum number of shadow casters. More... | |
void | SetMaximumNumShadowCasters (int nNum) |
set the maximum number of shadow casters. More... | |
int | GetMaximumNumShadowReceivers () |
get the maximum number of shadow receivers. More... | |
void | SetMaximumNumShadowReceivers (int nNum) |
set the maximum number of shadow receivers. More... | |
void | SetMaxCharTriangles (int nNum) |
set max number of character triangles allowed. More... | |
int | GetMaxCharTriangles () |
get max number of character triangles allowed. More... | |
void | SetMaxRenderCount (int nRenderImportance, int nCount) |
set the max number of objects to be rendered of a given render importance. More... | |
int | GetMaxRenderCount (int nRenderImportance) |
Get the max number of objects to be rendered of a given render importance. More... | |
bool | IsUsingFullScreenGlow () |
whether full screen glow effect is used. More... | |
void | EnableFullScreenGlow (bool bEnable) |
whether full screen glow effect is used. More... | |
bool | IsUsingScreenWaveEffect () |
void | EnableScreenWaveEffect (bool value) |
void | SetCursor (const char *szCursorFile, int nHotSpotX=-1, int nHotSpotY=-1) |
Set/Get cursor file when mouse is over it. More... | |
const std::string & | GetCursor (int *pnHotSpotX=0, int *pnHotSpotY=0) const |
void | SetGlowness (const Vector4 &Glowness) |
const Vector4 & | GetGlowness () |
void | SetShadowMapTexelSizeLevel (int nLevel) |
Set the size level of the shadow map. More... | |
void | SetShadowMapTexelSize (int nWidth, int nHeight) |
Set the size of the shadow map. More... | |
CMissileObject * | NewMissile () |
Create a new managed missile object. More... | |
bool | CheckObjectCullingMethod (DWORD dwMethod) |
CManagedLoader * | GetManagedLoader (string sName) |
get the managed loader by its name More... | |
bool | DeleteManagedLoader (string sName) |
delete a managed loader | |
CManagedLoader * | CreateManagedLoader (string sName) |
create a new managed loader. More... | |
void | AddConsoleStr (const char *pStr) |
void | ClearConsoleStr () |
bool | IsInitialized () |
when the device used by the scene have been initialized and ready for drawing. More... | |
void | OnTerrainChanged (const Vector3 &vCenter, float fRadius) |
This function is called manually to update characters in a square region. More... | |
void | ResetScene () |
reset the scene to blank. More... | |
Vector3 | GetRenderOrigin () |
get the render origin in the rendering coordinate system.rendering coordinate system is a 3D coordinate system parallel to the world coordinate system, but with a different origin called render origin.Render origin is an arbitrary 3D point chosen near the current camera eye position. More... | |
void | RegenerateRenderOrigin (const Vector3 &vPos) |
generate the render origin, so that it is near the given point in the world units this function is called by the camera class. More... | |
ParaTerrain::CGlobalTerrain * | GetGlobalTerrain () |
clean up all objects in the delete list. More... | |
bool | DeleteSentientObject (IGameObject *pObj) |
return true if the object is found and deleted. More... | |
void | AddSentientObject (IGameObject *pObj, bool bCheckDuplicate=false) |
add a new sentient object to the back of the sentient object list. More... | |
CTerrainTileRoot * | GetRootTile () |
get the root terrain tile of the quad tree. More... | |
CBaseCamera * | GetCurrentCamera () |
get current camera | |
CSkyMesh * | GetCurrentSky () |
return NULL if no sky defined. More... | |
bool | CreateSkyBox (const string &strObjectName, AssetEntity &MeshAsset, float fScaleX, float fScaleY, float fScaleZ, float fHeightOffset) |
create a sky box and add it to the current list, and select it as the current skybox. More... | |
bool | DeleteSkyBox (const string &strObjectName) |
delete a name sky box. More... | |
CSunLight & | GetSunLight () |
get sun light object More... | |
void | DestroyObjectByName (const char *id) |
IObject * | AttachObject (CBaseObject *pObject) |
Automatically attach a scene object to the scene graph according to its type and position. More... | |
bool | DetachObject (CBaseObject *pObject) |
detach an object from the scene graph. More... | |
virtual CBaseObject * | GetGlobalObject (const string &sName) |
get the global object by its name. More... | |
CBaseObject * | GetLocalObject (const string &sName, const Vector3 &vPos) |
Get an object. More... | |
CBaseObject * | GetLocalObject (const Vector3 &vPos, float fEpsilon=0.01f) |
get the first local object,whose position is very close to vPos. More... | |
CBaseObject * | GetLocalObject (const Vector3 &vPos, const std::string &sName, float fEpsilon=0.01f) |
CBaseObject * | GetObject (const string &sName, const Vector3 &vPos, bool bGlobal) |
this function is just a short cut for (bGlobal ? GetGlobalObject():GetLocalObject()) More... | |
CBaseObject * | FindObjectByNameAndType (const std::string &sName, const std::string &sClassName) |
find a named object by its name. More... | |
CBaseObject * | GetObjectByViewBox (const CShapeAABB &viewbox) |
get an object(usually a static mesh object) by a given view box. More... | |
int | GetObjectsBySphere (list< CBaseObject *> &output, const CShapeSphere &sphere, OBJECT_FILTER_CALLBACK pFnctFilter=NULL, int nMethod=0) |
Get objects inside or intersect with a sphere. More... | |
int | GetObjectsByScreenRect (list< CBaseObject *> &output, const RECT &rect, OBJECT_FILTER_CALLBACK pFnctFilter=NULL, float fMaxDistance=-1.f) |
Get objects inside or intersect with a screen rect. More... | |
CMiniSceneGraph * | GetPostProcessingScene () |
get the post processing mini scene graph. More... | |
void | EnablePostProcessing (bool bEnable, const char *sCallbackScript) |
set whether post processing is enabled. More... | |
bool | IsPostProcessingEnabled () |
get whether post processing is enabled. More... | |
CMiniSceneGraph * | GetMiniSceneGraph (const string &name) |
If the mini scene graph does not exist, it will be created. | |
int | DeleteMiniSceneGraph (const string &name) |
Delete mini scene graphs by name. More... | |
void | EnableMiniSceneGraph (bool bEnable) |
enable to render all mini scene graphs | |
bool | IsMiniSceneGraphEnabled () |
enable to render all mini scene graphs | |
const std::string & | GetAllMiniSceneGraphNames () |
get commar separated list of mini scene graph names, such as "name1,name2," | |
bool | DeleteObject (CBaseObject *pObject) |
delete a object from the scene. More... | |
void | ShowPortalSystem (bool bEnable) |
set whether portal zone and portals are rendered. | |
bool | IsPortalSystemShown () |
get whether portal zone and portals are rendered. More... | |
void | UnloadObjectResources (CBaseObject *pObject) |
unload the resources used by the specified object. More... | |
virtual HRESULT | InitDeviceObjects () |
– For device and input handling – | |
virtual HRESULT | DeleteDeviceObjects () |
virtual HRESULT | RestoreDeviceObjects () |
virtual HRESULT | InvalidateDeviceObjects () |
virtual HRESULT | RendererRecreated () |
virtual void | Cleanup () |
Desc: Called before the app exits, this function gives the app the chance to cleanup after itself.Animate the scene : Environment simulation is carried out by the scene. More... | |
float | PickClosest (const Vector3 &vPickRayOrig, const Vector3 &vPickRayDir, CBaseObject **pTouchedObject, Vector3 *vIntersectPos, Vector3 *vImpactNormal=NULL, bool bTestObject=false, float fMaxDistance=0, DWORD dwGroupMask=0xffffffff) |
Checks if mouse point hits any physical geometry in the current scene. More... | |
float | PickClosest (int nScreenX, int nScreenY, CBaseObject **pPickedObject, Vector3 *vIntersectPos, Vector3 *vImpactNormal=NULL, bool bTestObject=false, float fMaxDistance=0, DWORD dwGroupMask=0xffffffff) |
picking using a screen point instead of a ray | |
bool | PickObject (const CShapeRay &ray, CBaseObject **pTouchedObject, float fMaxDistance=0, OBJECT_FILTER_CALLBACK pFnctFilter=NULL) |
Pick object using view clipping object. More... | |
bool | PickObject (int nScreenX, int nScreenY, CBaseObject **pTouchedObject, float fMaxDistance=0, OBJECT_FILTER_CALLBACK pFnctFilter=NULL) |
int | SelectObject (int nGroupIndex, const CShapeOBB &box, OBJECT_FILTER_CALLBACK pFnctFilter=NULL) |
select select objects within a given region into a given group. More... | |
int | SelectObject (int nGroupIndex, const CShapeSphere &circle, OBJECT_FILTER_CALLBACK pFnctFilter=NULL) |
void | PauseGame () |
void | DisableGame () |
virtual void | Animate (double dTimeDelta, int nRenderNumber=0) |
Desc: Called once per frame, the call is the entry point for animating the scene. More... | |
HRESULT | AdvanceScene (double dTimeDelta, int nPipelineOrder=PIPELINE_3D_SCENE) |
build the render list, and render the entire scene. More... | |
void | UpdateFogColor () |
Vector3 | GetFogColor (float fAngle) |
get fog color based on current sun angle. More... | |
int | RenderSelection (DWORD dwSelection=0xffffffff, double dTimeDelta=0) |
render objects in the post rendering list. More... | |
int | RenderCharacters (SceneState &sceneState, SceneState::List_PostRenderObject_TrackRef_Type &listPRBiped) |
render characters More... | |
int | RenderHeadOnDisplay (int nPass=0) |
render the head on display, return the number of objects rendered More... | |
CMirrorSurface * | GetMirrorSurface (int nIndex) |
It will create the mirror surface if not exist. More... | |
virtual HRESULT | Draw (SceneState *sceneState) |
only for drawable objects | |
void | RenderShadows () |
Shadow volume rendering. More... | |
void | RenderShadowMap () |
render the shadow volume More... | |
void | RenderFullScreenGlowEffect () |
render the full screen glow effect | |
void | RenderScreenWaveEffect () |
void | ApplyWaterFogParam () |
void | RestoreSceneFogParam () |
void | SetCurrentPlayer (CBipedObject *pPlayer) |
set the current player | |
CBipedObject * | GetCurrentPlayer () |
get the current player More... | |
CBipedObject * | GetNextPlayer (CBipedObject *pObj) |
get the next scene object. More... | |
bool | HandleUserInput () |
handle user input return true if there is a handler | |
CSceneScripts & | GetScripts () |
get script interface for reading and writing. More... | |
void | EnableMouseEvent (bool bEnable, DWORD dwEvents=0xffff) |
Whether to generate mouse events for the scene objects. More... | |
const CEventBinding * | GetEventBinding () |
Get the current event binding object. More... | |
void | LoadDefaultEventBinding () |
load the default camera key and mouse event binding. More... | |
CBaseObject * | GetCurrentActor () |
get the actor that is being processed by the AI module or a script call back. More... | |
void | SetCurrentActor (CBaseObject *pActor) |
Set the actor that is being processed by the AI module or a script call back. More... | |
void | UpdateOcean () |
call this function, when the ocean has changed or the environment has changed. More... | |
int | SaveLocalCharacters () |
save all modified and unsaved local characters in the scene to the current NPC database. More... | |
int | SaveAllCharacters () |
save all local characters in the scene to the current NPC database regardless of whether they are modified or not this function is usually called manually in some very rare cases. More... | |
int | SaveCharacterToDB (IGameObject *pObj) |
save the given character to current database no matter it is modified or not. More... | |
int | RemoveCharacterFromDB (IGameObject *pObj) |
remove a character from DB. More... | |
bool | IsPersistent () |
get whether the scene can be automatically marked as modified | |
void | SetPersistent (bool bPersistent) |
set whether the scene can be automatically marked as modified | |
virtual void | SetCandrag (bool bCandrag) |
implementing IObjectDrag Interface | |
virtual bool | GetCandrag () const |
virtual void | BeginDrag (int nEvent, int x, int y, int z) |
Default BeginDrag handle function. More... | |
virtual void | EndDrag (int nEvent, int x, int y, int z) |
Default EndDrag handle function. More... | |
virtual BOOL | IsOnObject (int x, int y, int z) |
Decide whether the input position is on this object This function is to help other function to decide if the currently pointing position is logically "on" the object. More... | |
bool | IsPickingObject () |
CBaseObject * | TogglePlayer () |
It changes the current player to the next player in the scene. More... | |
bool | LoadNPCByNPCDbItem (CNpcDbItem &npc, CRpgCharacter **pOut, bool bReload=false) |
load a character from the database. More... | |
bool | DB_LoadNPCByID (int nNPCID, CRpgCharacter **pOut, bool bReload=false) |
load a character from the database More... | |
bool | DB_LoadNPCByName (const string &sName, CRpgCharacter **pOut, bool bReload=false) |
load a character from the database More... | |
int | DB_LoadNPCsByRegion (const Vector3 &vMin, const Vector3 &vMax, bool bReload=false) |
return all NPC whose position is within a AABB region More... | |
void | SetFullscreenGlowIntensity (float fGlowIntensity) |
full screen glow effect is parameterized by the blending weight of the source image and the glow image. More... | |
float | GetFullscreenGlowIntensity () |
void | SetFullscreenGlowBlendingFactor (float fGlowFactor) |
full screen glow effect is parameterized by the blending weight of the source image and the glow image. More... | |
float | GetFullscreenGlowBlendingFactor () |
bool | IsAutoPlayerRippleEnabled () |
the current player will automatically generate ripples near the water surface | |
void | EnableAutoPlayerRipple (bool bEnable) |
the current player will automatically generate ripples near the water surface | |
bool | IsPortalZoneEnabled () |
enable portal and zone rendering. More... | |
void | EnablePortalZone (bool bEnable) |
enable portal and zone rendering. More... | |
bool | IsUseWireFrame () |
whether to use wire frame | |
void | SetUseWireFrame (bool UseWireFrame) |
set whether to use wire frame | |
list_IObjectWeakPtr_Type & | GetSentientObjects () |
get the list of sentient objects. More... | |
MissileObjectPool_Type & | GetMissiles () |
return a list of missile objects. More... | |
void | SetEnvironmentSim (IEnvironmentSim *pSim) |
set the environment simulator to be used with this world. More... | |
SceneState * | GetSceneState () |
get the scene state information. More... | |
CPhysicsWorld * | GetPhysicsWorld () |
IEnvironmentSim * | GetEnvSim () |
IParaDebugDraw * | GetDebugDrawer () |
deprecated: use GetBatchedElementDrawer() | |
IBatchedElementDraw * | GetBatchedElementDrawer () |
void | SetPhysicsDebugDrawMode (int nMode) |
set the physics debug draw mode. More... | |
int | GetPhysicsDebugDrawMode () |
set the physics debug draw mode. More... | |
void | SetOnClickDistance (float fDist) |
the mouse ray picking distance for onclick event. More... | |
float | GetOnClickDistance () |
CZoneNode * | CreateGetZoneNode (const char *sName) |
get a zone node by its name. More... | |
CZoneNode * | GetZoneNode (const char *sName) |
get a zone node by its name. More... | |
CPortalNode * | CreateGetPortalNode (const char *sName) |
get a portal node by its name. More... | |
CPortalNode * | GetPortalNode (const char *sName) |
get a portal node by its name. More... | |
virtual float | GetShadowRadius () |
get the distance from the eye, within which shadow map will be used. More... | |
void | SetShadowRadius (float fShadowRadius) |
bool | IsBlockInput () |
whether to block all user input (both key and mouse). More... | |
void | SetBlockInput (bool bBlockInput) |
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 | |
bool | IsDropShadow () |
void | SetDropShadow (bool useDropShadow) |
void | AddToDeadObjectPool (CBaseObject *pObject) |
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... | |
void | RemoveDeadObjects () |
![]() | |
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 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 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 void | SetOpacity (float fOpacity) |
virtual float | GetOpacity () |
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 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 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 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 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 | |
![]() | |
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 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 | 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 | |
![]() | |
virtual void | SetPositionI (const CGUIPosition &position) |
restore to a given position. More... | |
![]() | |
virtual CBaseObject * | GetGlobalObject (const std::string &sName) |
get the global object by its name. More... | |
Static Public Member Functions | |
static CSceneObject * | GetInstance () |
this function may return NULL, if scene object is never created. More... | |
![]() | |
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 bool | CancelDrag (STRUCT_DRAG_AND_DROP *pdrag) |
try cancel the drag operation. More... | |
Static Public Attributes | |
static CSceneObject * | g_pRootscene = NULL |
![]() | |
static STRUCT_DRAG_AND_DROP | DraggingObject |
This structure contains the information about the dragging object. | |
Protected Attributes | |
IEnvironmentSim * | m_pEnvironmentSim |
ref_ptr< CPhysicsWorld > | m_pPhysicsWorld |
current physics engine and simulation engine | |
CBatchedElementDraw * | m_pBatchedElementDraw |
physics world More... | |
list_IObjectWeakPtr_Type | m_sentientGameObjects |
it keeps a reference to all active (sentient) game objects in the scene. More... | |
MissileObjectPool_Type | m_missiles |
a list of missile objects. More... | |
map< string, CZoneNode * > | m_zones |
store all zones in a map from zone name to its pointer | |
map< string, CPortalNode * > | m_portals |
store all zones in a map from zone name to its pointer | |
ref_ptr< CTerrainTileRoot > | m_pTileRoot |
a quad tree object that hold most static (regional mobile) objects according to its spatial parameters | |
unordered_ref_array< CBaseObject * > | m_dead_objects |
dead objects pool. More... | |
char | m_sConsoleString [200] |
console string the console panel string | |
float | m_fOnClickDistance |
the mouse ray picking distance for onclick event. More... | |
bool | m_bUseInstancing |
whether to use instancing during scene rendering. More... | |
bool | m_bIsPersistent |
whether the scene can be automatically marked as modified | |
bool | m_bShowMainPlayer |
whether to show the main player | |
bool | m_bCanShowMainPlayer |
whether current camera allows showing the main player | |
vector< int > | m_MaxRenderCount |
m_MaxRenderCount[RenderImportance] is the max number of objects to be rendered of a given render importance | |
std::string | m_sMiniSceneGraphNames |
comma separated list of mini scene graphs | |
std::string | m_sCursorFile |
the cursor to be displayed when mouse over it. More... | |
int16 | m_nCursorHotSpotX |
default to -1, which is using current hardware value. More... | |
int16 | m_nCursorHotSpotY |
default to -1, which is using current hardware value. More... | |
DWORD | m_dwPhysicsGroupMask |
groups Mask used to filter physics objects, default to 0xffffffff | |
float | m_fPostRenderQueueOrder |
this is always 100.f | |
unordered_ref_array< IAttributeFields * > | m_attribute_models |
attribute models in the second column | |
![]() | |
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 | |
![]() | |
bool | m_bCandrag |
Friends | |
class | CParaEngineApp |
Additional Inherited Members | |
![]() | |
virtual CAttributeClass * | CreateAttributeClass () |
initialize fields | |
virtual CDynamicAttributesSet * | GetDynamicAttributes (bool bCreateIfNotExist=false) |
![]() | |
static int | g_nObjectSelectionEffect = ParaEngine::RenderSelectionStyle_border |
enum of RenderSelectionStyle More... | |
The top level scene management class.
This is the single most important class in the game engine. It manages all game objects in a tree hierarchy. The tree is flat in the its root node, but deep on some of its child nodes. For examples, on the root of the scene object is a flat list of engine objects, such as the global terrain, the camera, the global bipeds, the physics, the asset manager, the render state, the sky boxes, the quad tree for holding all 3D scene objects, the AI simulator, 2D GUI, etc.
The scene object class also controls most global states of the 3D scene, such as fog, shadow and some debugging information.
a bit wise field for object level culling parameters.
All method will Automatically adjust the view radius according to the fog near and far plane as well as the size of the object. The following formula is used to decide the view radius. Let R be the radius of the object. Let fNear be the near plane distance of the fog, and fFar be the far plane distance of the fog The view radius ViewRadius is given be the formula: ViewRadius(R) = max((fFar-Pow2(fNear*tanf(m_fCullingAngle))*density*(fFar-fNear)/(R*R)), fNear); The formula ensures that the pixel changes of any newly popped out object are a roughly a constant. Small objects will only be drawn when they are very close to the near fog plane, whereas large object will be drawn as soon as they are within the far fog plane.
CSceneObject::CSceneObject | ( | ) |
physics world
game status
set fog
Default view culling radius view-culling: render objects within 30 meters from the eye position
turn on sky rendering, if there is any available sky meshes
void CSceneObject::AddSentientObject | ( | IGameObject * | pObj, |
bool | bCheckDuplicate = false |
||
) |
add a new sentient object to the back of the sentient object list.
The sentient count of the newly added object is automatically increased by 1
bCheckDuplicate | if true, If the object is already in the list, it will not be reinserted. |
void CSceneObject::AddToDeadObjectPool | ( | CBaseObject * | pObject | ) |
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.
HRESULT CSceneObject::AdvanceScene | ( | double | dTimeDelta, |
int | nPipelineOrder = PIPELINE_3D_SCENE |
||
) |
build the render list, and render the entire scene.
Desc: Advances the local animation time by dTimeDelta, and render it.
dTimeDelta | fAnimation delta time in seconds. |
nPipelineOrder | the current pipeline order, default to PIPELINE_3D_SCENE, which is anything before UI. specify over PIPELINE_POST_UI_3D_SCENE for anything after UI is drawn. |
Basic view culling is also done here. Note: Note that for any multianimation object, it's important that AdvanceTime() and Draw() must be called in succession.
draw the terrain
All potentially visible scene objects in the scene state are put to three major post rendering lists for rendering. Each list is sorted according to object-to-camera distance. And then they will be rendered in the following order:
draw solid object rendering list from front to back.
Draw queued bipeds we draw biped after its shadow, because we do not want biped to cast shadows on its own
Draw SkyBox : we shall render sky after terrain but before transparent meshes, to make z-buffer work better.
draw missile objects
render all particle system instances after most of the scene have been rendered. it is rendered after ocean to prevent the ocean color over the particles. since all particles are z write disabled.
the particle system instance count and the total particle counts are now reported to the console in the format: nParticles: %2 where %2 is the total particle counts
|
virtual |
Desc: Called once per frame, the call is the entry point for animating the scene.
Animate the camera. This should match the speed of rendering, otherwise the scene will not seem to move.
Update the camera
report current player position and facing
Reimplemented from ParaEngine::CBaseObject.
IObject * CSceneObject::AttachObject | ( | CBaseObject * | pObject | ) |
Automatically attach a scene object to the scene graph according to its type and position.
The object can be a manager loader, a global object or any ordinary scene object.
|
inlinevirtual |
Default BeginDrag handle function.
x,y,z | position of where the drag begins x, y, z are screen coordinates. In most cases, z is zero. |
nEvent | tells which event triggers the begin drag. This value will set to the STRUCT_DRAG_AND_DROP::nEvent |
Implements ParaEngine::IObjectDrag.
|
inline |
dwMethod | a bit wise combination of OBJECT_LEVEL_CULLING_METHOD |
|
virtual |
Desc: Called before the app exits, this function gives the app the chance to cleanup after itself.Animate the scene : Environment simulation is carried out by the scene.
remove all portals
remove all zones
remove all loaders
delete m_cameras
delete Sky meshes
delete children
delete shadow volumes
reset physics environment
Reimplemented from ParaEngine::CBaseObject.
void CSceneObject::ClearParticles | ( | ) |
clear all particles.
useful for switching scenes.
CPortalNode * CSceneObject::CreateGetPortalNode | ( | const char * | sName | ) |
get a portal node by its name.
it will create an empty one if it does not exist
CZoneNode * CSceneObject::CreateGetZoneNode | ( | const char * | sName | ) |
get a zone node by its name.
it will create an empty one if it does not exist
CManagedLoader * CSceneObject::CreateManagedLoader | ( | string | sName | ) |
create a new managed loader.
if the loader already exists, the old one is returned. this function will never return NULL.
bool CSceneObject::CreateSkyBox | ( | const string & | strObjectName, |
AssetEntity & | MeshAsset, | ||
float | fScaleX, | ||
float | fScaleY, | ||
float | fScaleZ, | ||
float | fHeightOffset | ||
) |
create a sky box and add it to the current list, and select it as the current skybox.
sky box with the same name will not be recreated,but will be selected as the current sky box.
strObjectName | this can be "". return true if succeeded |
bool CSceneObject::DB_LoadNPCByID | ( | int | nNPCID, |
CRpgCharacter ** | pOut, | ||
bool | bReload = false |
||
) |
load a character from the database
nNPCID | character ID in the database |
pOut | : the structure will be filled with data in the database |
bReload | if the character already exists in the scene and it is true, the character will be updated with the parameter in the database |
bool CSceneObject::DB_LoadNPCByName | ( | const string & | sName, |
CRpgCharacter ** | pOut, | ||
bool | bReload = false |
||
) |
load a character from the database
sName | character name |
pOut | : the structure will be filled with data in the database |
bReload | if the character already exists in the scene and it is true, the character will be updated with the parameter in the database |
int CSceneObject::DB_LoadNPCsByRegion | ( | const Vector3 & | vMin, |
const Vector3 & | vMax, | ||
bool | bReload = false |
||
) |
return all NPC whose position is within a AABB region
pOut | : the list will be filled with data in the database that meat the criterion. |
vMin | min point in world coordinate system, y component is ignored |
vMax | max point in world coordinate system, y component is ignored |
bReload | if the character already exists in the scene and it is true, the character will be updated with the parameter in the database |
int CSceneObject::DeleteMiniSceneGraph | ( | const string & | name | ) |
Delete mini scene graphs by name.
if name is "" or "*", all mini scene graphs will be deleted.
bool CSceneObject::DeleteObject | ( | CBaseObject * | pObject | ) |
delete a object from the scene.
The object can be a manager loader, a global object or any ordinary scene object It will first find the object in the scene, detach it and delete it. Please be very careful with this function. the object can no longer be used once it has been deleted
pObject | the object to be deleted. |
bool CSceneObject::DeleteSentientObject | ( | IGameObject * | pObj | ) |
return true if the object is found and deleted.
bool CSceneObject::DeleteSkyBox | ( | const string & | strObjectName | ) |
delete a name sky box.
strObjectName | if this is "", all sky boxes will be deleted. |
bool CSceneObject::DetachObject | ( | CBaseObject * | pObject | ) |
detach an object from the scene graph.
The object can be a manager loader, a global object or any ordinary scene object. Do not delete the object immediately after detaching it from the scene, unless you are sure that there are no references to it elsewhere. currently, the object's type and location is used to locate the object in the scene graph in a very fast way. It will only search for objects which are attached to terrain tile. If an object is attached to another scene object it will not be found. the function will return once the first matching object is found and detached
pObject | the object to be detached. |
compress object, so that physics and resource assets will be released.
|
inline |
void CSceneObject::EnableFullScreenGlow | ( | bool | bEnable | ) |
whether full screen glow effect is used.
void CSceneObject::EnableMouseEvent | ( | bool | bEnable, |
DWORD | dwEvents = 0xffff |
||
) |
Whether to generate mouse events for the scene objects.
bEnable | true to enable, false to disable. |
dwEvents | what kind of mouse events are affected. Use 0xffff to affect all. |
|
inline |
enable portal and zone rendering.
so that we can see the effect before and after portal rendering.
void CSceneObject::EnablePostProcessing | ( | bool | bEnable, |
const char * | sCallbackScript | ||
) |
set whether post processing is enabled.
bEnable | bool |
sCallbackScript | if bEnabled is true, this is a callback script to be called per frame at which one can process scene after the main 3d scene is rendered. if this is NULL, the old callback script is used. |
|
inlinevirtual |
Default EndDrag handle function.
x,y,z | position of where the drag begins x, y, z are screen coordinates. In most cases, z is zero. |
nEvent | tells which event triggers the end drag. You may test this value against the STRUCT_DRAG_AND_DROP::nEvent to see if this end drag is acceptable. |
Implements ParaEngine::IObjectDrag.
CBaseObject * CSceneObject::FindObjectByNameAndType | ( | const std::string & | sName, |
const std::string & | sClassName | ||
) |
find a named object by its name.
It is usually used to search for automatically attached objects, such as RenderTargets. this function is not fast, since it will search linearly.
|
inlinevirtual |
attribute class ID should be identical, unless one knows how overriding rules work.
Reimplemented from ParaEngine::CBaseObject.
|
virtual |
Get the color of the scene ground when it is not enabled.When scene is enabled, the background color is always the fog color.
Implements ParaEngine::IScene.
|
virtual |
we support multi-dimensional child object.
by default objects have only one column.
Reimplemented from ParaEngine::CBaseObject.
|
virtual |
get attribute by child object.
used to iterate across the attribute field hierarchy.
Reimplemented from ParaEngine::CBaseObject.
|
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::CBaseObject.
ParaEngine::LinearColor CSceneObject::GetClearColor | ( | ) |
Get the color of the scene ground when it is not enabled.When scene is enabled, the background color is always the fog color.
CBaseObject * CSceneObject::GetCurrentActor | ( | ) |
get the actor that is being processed by the AI module or a script call back.
The validity of the pointer is not guaranteed.
CBipedObject * CSceneObject::GetCurrentPlayer | ( | ) |
get the current player
desc: GetCurrentPlayer, the first element in the m_player list.
if the list is empty, NULL is returned
CSkyMesh * CSceneObject::GetCurrentSky | ( | ) |
return NULL if no sky defined.
const CEventBinding * CSceneObject::GetEventBinding | ( | ) |
Get the current event binding object.
this may return NULL.
Vector3 CSceneObject::GetFogColor | ( | float | fAngle | ) |
get fog color based on current sun angle.
|
virtual |
get the global object by its name.
If there have been several objects with the same name, the most recently attached object is returned.
sName | exact name of the object |
ParaTerrain::CGlobalTerrain * CSceneObject::GetGlobalTerrain | ( | ) |
clean up all objects in the delete list.
This function is called at the beginning of each frame, during the rest of the frame, objects may be added to the delete list for deletion in the next frame. the global terrain object
|
static |
this function may return NULL, if scene object is never created.
CBaseObject * CSceneObject::GetLocalObject | ( | const string & | sName, |
const Vector3 & | vPos | ||
) |
Get an object.
Call this function to see if object with a given identifier is already attached.
sName | name of the object, if this is "", the function always returns NULL |
vPos | the location to search for the object. |
CBaseObject * CSceneObject::GetLocalObject | ( | const Vector3 & | vPos, |
float | fEpsilon = 0.01f |
||
) |
get the first local object,whose position is very close to vPos.
This function will search for the first (local mesh) object throughout the hierachy of the scene. this function is kind of slow, please do not call on a per frame basis. Use GetObjectByViewBox() to get an object faster.
vPos | world position of the local mesh object |
fEpsilon | if a mesh is close enough to vPos within this value. |
CManagedLoader * CSceneObject::GetManagedLoader | ( | string | sName | ) |
get the managed loader by its name
int CSceneObject::GetMaxCharTriangles | ( | ) |
get max number of character triangles allowed.
we render characters from front to back. and if the previously drawn character count exceed this value we will stop rendering the rest of the characters. this value defaults to 50000
int CSceneObject::GetMaximumNumShadowCasters | ( | ) |
get the maximum number of shadow casters.
int CSceneObject::GetMaximumNumShadowReceivers | ( | ) |
get the maximum number of shadow receivers.
int CSceneObject::GetMaxLocalLightsNum | ( | ) |
get maximum number of local lights per object.
int CSceneObject::GetMaxRenderCount | ( | int | nRenderImportance | ) |
Get the max number of objects to be rendered of a given render importance.
One can set the render importance of any objects by setting its "RenderImportance" property
nRenderImportance | the render importance to set. All objects are by default set with render importance 0. |
|
inline |
all objects must be drawn when they are within this radius.
Default value is 15 meters
CMirrorSurface * CSceneObject::GetMirrorSurface | ( | int | nIndex | ) |
It will create the mirror surface if not exist.
nIndex | index of surface. |
|
inline |
return a list of missile objects.
Missile objects will always be tested for rendered on a per-frame basis.
CBipedObject * CSceneObject::GetNextPlayer | ( | CBipedObject * | pObj | ) |
get the next scene object.
pObj | the object whose next object is retrieved. |
the NULL is returned if the given character is not found.
CBaseObject * CSceneObject::GetObject | ( | const string & | sName, |
const Vector3 & | vPos, | ||
bool | bGlobal | ||
) |
this function is just a short cut for (bGlobal ? GetGlobalObject():GetLocalObject())
sName | |
vPos | |
bGlobal | if this is true, vPos can be any value. |
CBaseObject * CSceneObject::GetObjectByViewBox | ( | const CShapeAABB & | viewbox | ) |
get an object(usually a static mesh object) by a given view box.
viewbox | One can get the view box by getting the view culling object. see example in the ParaObject:GetViewBox(). |
int CSceneObject::GetObjectsByScreenRect | ( | list< CBaseObject *> & | output, |
const RECT & | rect, | ||
OBJECT_FILTER_CALLBACK | pFnctFilter = NULL , |
||
float | fMaxDistance = -1.f |
||
) |
Get objects inside or intersect with a screen rect.
screen rect is translated to a 3d cone from the camera eye position to a plane fMaxDistance away. This function is usually used for finding other static mesh objects near a certain character. please note that: objects must be completely inside the near and far planes in order to pass the test.
output | list to get the result |
rect | the rect in screen space coordinates |
fMaxDistance | the world unit distance inside which we will test possible candidates. if negative, it will get all visible ones. |
pFnctFilter | a callback function to further filter selected object. if it is NULL, any scene object could be selected. |
select object on root tile
int CSceneObject::GetObjectsBySphere | ( | list< CBaseObject *> & | output, |
const CShapeSphere & | sphere, | ||
OBJECT_FILTER_CALLBACK | pFnctFilter = NULL , |
||
int | nMethod = 0 |
||
) |
Get objects inside or intersect with a sphere.
By default it just uses a rough testing between spheres. This function is usually used for finding other static mesh objects near a certain character.
output | list to get the result |
sphere | sphere, if this is big, it could be time consuming. |
pFnctFilter | a callback function to further filter selected object. if it is NULL, any scene object could be selected. |
nMethod | testing method, 0 for rough. |
select object on root tile
add all visitor biped objects, only the last time will have this list non-empty
breadth first transversing the scene(the root tile is ignored) pTile is now the root tile. object attached to it are never rendered directly
add other tiles
rough culling algorithm using the quad tree terrain tiles test against a sphere round the eye
go down the quad tree terrain tile to render objects
even we know that the tile is empty, we still need to see if there is anything in the queueNode for rendering so when both queue are empty, we can exit the main rendering transversing loop
For each free space object in the tile
add all solid objects to the queue for further testing
add all visitor biped objects to the queue.
int CSceneObject::GetPhysicsDebugDrawMode | ( | ) |
set the physics debug draw mode.
it is a bitwise field of PhysicsDebugDrawModes
nMode | 0 to disable it. -1(0xffff) to enable full debug mode drawing for current physics. |
CPortalNode * CSceneObject::GetPortalNode | ( | const char * | sName | ) |
get a portal node by its name.
it will return NULL if it does not exist
CMiniSceneGraph * CSceneObject::GetPostProcessingScene | ( | ) |
get the post processing mini scene graph.
|
virtual |
get the render origin in the rendering coordinate system.rendering coordinate system is a 3D coordinate system parallel to the world coordinate system, but with a different origin called render origin.Render origin is an arbitrary 3D point chosen near the current camera eye position.
All scene objects and the camera view are transformed to the rendering coordinate system for rendering. This is because if we use the world coordinate system for rendering, the components of transform matrix that is used for object manipulation will be inconsistent (i.e. of different magnitudes.) By doing so, it will correct floating point calculation imprecisions, due to large numbers in object's coordinates, such as the simple addition of (20000.01f+0.01234f). The result of using world coordinate system for rendering is that we will get increasingly jerky object on screen as its global position shifts away from the origin of the world coordinate system.(this is usually the case for games with a very large map. One may consider using double type to store the global position of scene object in world units.) In the rendering coordinate system, however, all components in the matrix will be comparatively small and consistent. Hence objects can be positioned more precisely near the render origin, which is near the camera eye position.
Implements ParaEngine::IScene.
|
inline |
get the root terrain tile of the quad tree.
|
inlinevirtual |
get the scene state information.
The scene state contains information about the current simulation and render states.Such as which scene object is being animated or rendered, etc
Implements ParaEngine::IScene.
CSceneScripts & CSceneObject::GetScripts | ( | ) |
get script interface for reading and writing.
|
inline |
get the list of sentient objects.
|
inlinevirtual |
get the distance from the eye, within which shadow map will be used.
This should match the value in shadow map shader.
Reimplemented from ParaEngine::IScene.
|
virtual |
CZoneNode * CSceneObject::GetZoneNode | ( | const char * | sName | ) |
get a zone node by its name.
it will return NULL if it does not exist
|
virtual |
this class should be implemented if one wants to add new attribute.
This function is always called internally.
Reimplemented from ParaEngine::CBaseObject.
|
inline |
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.
bool CSceneObject::IsForceExportPhysics | ( | ) |
get whether physics of MeshPhysicsObject is always exported regardless of per object settings.
|
inline |
whether to use generate scene report.
bool CSceneObject::IsInitialized | ( | ) |
when the device used by the scene have been initialized and ready for drawing.
|
inline |
whether to use instancing.
It is disabled by default.
|
inline |
whether to use occlusion query algorithm for rendering.
|
virtual |
Decide whether the input position is on this object This function is to help other function to decide if the currently pointing position is logically "on" the object.
x,y,z | position of where the drag begins x, y, z are screen coordinates. In most cases, z is zero. |
Implements ParaEngine::IObjectDrag.
bool CSceneObject::IsPortalSystemShown | ( | ) |
get whether portal zone and portals are rendered.
|
inline |
enable portal and zone rendering.
so that we can see the effect before and after portal rendering.
bool CSceneObject::IsPostProcessingEnabled | ( | ) |
get whether post processing is enabled.
|
inline |
whether 3D scene is enabled or not.
a disabled scene is not visible no matter what
|
inline |
when a scene is paused, all animation will be frozen.
|
inline |
whether to draw bounding box of scene objects.
bool CSceneObject::IsShowLocalLightMesh | ( | ) |
whether show the arrow mesh associated with the light object.
bool CSceneObject::IsShowMainPlayer | ( | ) |
whether to show main player.
default to true.
bool CSceneObject::IsUsingFullScreenGlow | ( | ) |
whether full screen glow effect is used.
void CSceneObject::LoadDefaultEventBinding | ( | ) |
load the default camera key and mouse event binding.
bool CSceneObject::LoadNPCByNPCDbItem | ( | CNpcDbItem & | npc, |
CRpgCharacter ** | pOut, | ||
bool | bReload = false |
||
) |
load a character from the database.
This function is usually called internally by DB_Load*() functions.
npc | the npc database item. |
pOut | : the structure will be filled with data in the database |
bReload | if the character already exists in the scene and it is true, the character will be updated with the parameter in the database |
CMissileObject * CSceneObject::NewMissile | ( | ) |
Create a new managed missile object.
find in memory if there is any exploded missile which can be reused.
void CSceneObject::OnTerrainChanged | ( | const Vector3 & | vCenter, |
float | fRadius | ||
) |
This function is called manually to update characters in a square region.
So that when the terrain heightfield is changed, the characters within the region will act accordingly, either falling down or snap to terrain surface.
vCenter | : center of the terrain region being modified. |
fRadius | : radius of the terrain region being modified. |
|
inline |
float ParaEngine::CSceneObject::PickClosest | ( | const Vector3 & | vPickRayOrig, |
const Vector3 & | vPickRayDir, | ||
CBaseObject ** | pTouchedObject, | ||
Vector3 * | vIntersectPos, | ||
Vector3 * | vImpactNormal = NULL , |
||
bool | bTestObject = false , |
||
float | fMaxDistance = 0 , |
||
DWORD | dwGroupMask = 0xffffffff |
||
) |
Checks if mouse point hits any physical geometry in the current scene.
We will tranverse the last render queue to find a match instead of traverse the entire scene. Here physical geometry may be the global terrain or any loaded physical objects. Both the hit object and the hit point will be returned
vPickRayOrig: the mouse ray's origin in the world view. vPickRayDir: the mouse ray's direction in the world view.(must be normalized) pPickedObject: [out] the scene object that collide with the mouse ray. This may be NULL, if no object is found. vIntersectPos: [out] this is the hit point in world coordinate system. if a scene object is picked, this will be the object's world position vImpactNormal: Impact normal. If normal can not be retrieved, this value will be set to (0,0,0). So always compare with 0 before using the normal. bTestObject: if this is false, we will only test the global terrain and level mesh in the scene. ignoring all scene objects (pPickedObject is always set to NULL). if this is true, scene object is also tested. fMaxDistance: the longest distance from the ray origin to check for collision. If the value is 0 or negative, the view culling radius is used as the fMaxDistance. dwGroupMask: groups Mask used to filter physics objects, default to 0xFFFFffff
for simplicity, we will find the nearest biped object in sceneState.listPRBiped (a list of biped in the view), instead of transversing the scene graph to find them.
bool ParaEngine::CSceneObject::PickObject | ( | const CShapeRay & | ray, |
CBaseObject ** | pTouchedObject, | ||
float | fMaxDistance = 0 , |
||
OBJECT_FILTER_CALLBACK | pFnctFilter = NULL |
||
) |
Pick object using view clipping object.
pick the smallest intersected object which is un-occluded by any objects. Object A is considered occluded by object B only if (1) both A and B intersect with the hit ray. (2) both A and B do not intersect with each other. (3) B is in front of A, with regard to the ray origin.
this function will ray-pick any loaded scene object(biped & mesh, but excluding the terrain) using their oriented bounding box. a filter function may be provided to further filter selected object. this function will transform all objects to near-camera coordinate system. This will remove some floating point inaccuracy near the camera position.Hence this function is most suitable for testing object near the camera eye position. This function does not rely on the physics engine to perform ray-picking.
ray | the ray in world space pPickedObject: [out] the scene object that collide with the mouse ray. This may be NULL, if no object is found. fMaxDistance: the longest distance from the ray origin to check for collision. If the value is 0 or negative, the view culling radius is used as the fMaxDistance. dwGroupMask: groups Mask used to filter physics objects, default to 0xFFFFffff |
pick object in the physics engine. This is accurate.
select object on root tile
add all visitor biped objects, only the last time will have this list non-empty
breadth first transversing the scene(the root tile is ignored) pTile is now the root tile. object attached to it are never rendered directly
add other tiles
rough culling algorithm using the quad tree terrain tiles test against a sphere round the eye
go down the quad tree terrain tile to render objects
even we know that the tile is empty, we still need to see if there is anything in the queueNode for rendering so when both queue are empty, we can exit the main rendering transversing loop
We will not push objects in the current terrain tile to a queue object for further view clipping.
add all solid objects to the queue for further testing
add all visitor biped objects to the queue.
add all free space objects to the queue
For any potentially visible objects in the queue, perform further object-level clipping test, and draw them if the test passes.
bool ParaEngine::CSceneObject::PickObject | ( | int | nScreenX, |
int | nScreenY, | ||
CBaseObject ** | pTouchedObject, | ||
float | fMaxDistance = 0 , |
||
OBJECT_FILTER_CALLBACK | pFnctFilter = NULL |
||
) |
void CSceneObject::RegenerateRenderOrigin | ( | const Vector3 & | vPos | ) |
generate the render origin, so that it is near the given point in the world units this function is called by the camera class.
As a general rule, whenever the camera moves, the render origin should be regenerated.
vPos | this is usually the current camera eye position in the world unit. |
int CSceneObject::RemoveCharacterFromDB | ( | IGameObject * | pObj | ) |
int CSceneObject::RenderCharacters | ( | SceneState & | sceneState, |
SceneState::List_PostRenderObject_TrackRef_Type & | listPRBiped | ||
) |
render characters
sort by the primary asset : in this case it's MA
int CSceneObject::RenderHeadOnDisplay | ( | int | nPass = 0 | ) |
render the head on display, return the number of objects rendered
nPass | 0 means standard scene object headon display. 1 means overlay headon display. |
int CSceneObject::RenderSelection | ( | DWORD | dwSelection = 0xffffffff , |
double | dTimeDelta = 0 |
||
) |
render objects in the post rendering list.
This function can be called to render to texture render targets if multiple objects are in selection, it will draw them in internally preferred order. it will assume that the camera and world transform has already been set. It will just call the render method of respective scene objects.
dwSelection | any bit combination of RENDER_GROUP, default is render all scene object. |
draw solid object rendering list from front to back.
Draw all characters including the player itself.
Draw all characters including the player itself.
– Draw all characters including the player itself.
for globally un-updated instances, animate the remaining particles
for local un-updated instances, delete the instance.
for globally updated instances, just draw it.
for local updated instances, ignore it, since it has already been draw with the model to which it is attached.
– Draw all characters including the player itself.
post rendering objects
void CSceneObject::RenderShadowMap | ( | ) |
render the shadow volume
render the shadow map
void CSceneObject::RenderShadows | ( | ) |
Shadow volume rendering.
void CSceneObject::ResetScene | ( | ) |
reset the scene to blank.
create a default camera Camera for interactive character navigation
default tile root
int CSceneObject::SaveAllCharacters | ( | ) |
save all local characters in the scene to the current NPC database regardless of whether they are modified or not this function is usually called manually in some very rare cases.
In most cases, call SaveLocalCharacters() instead.
int CSceneObject::SaveCharacterToDB | ( | IGameObject * | pObj | ) |
save the given character to current database no matter it is modified or not.
it will only if the character is persistent.
int CSceneObject::SaveLocalCharacters | ( | ) |
save all modified and unsaved local characters in the scene to the current NPC database.
this function is usually called automatically when the terrain modification bit is set.
bool CSceneObject::ScreenShotGlowMap | ( | ) |
take a screen shot of the current glow texture and save it to .
/screenshot directory
bool CSceneObject::ScreenShotReflection | ( | ) |
take a screen shot of the current reflection map and save it to .
/screenshot directory
bool CSceneObject::ScreenShotShadowMap | ( | ) |
take a screen shot of the current shadow map and save it to .
/screenshot directory
int ParaEngine::CSceneObject::SelectObject | ( | int | nGroupIndex, |
const CShapeOBB & | box, | ||
OBJECT_FILTER_CALLBACK | pFnctFilter = NULL |
||
) |
select select objects within a given region into a given group.
nGroupIndex | which group to select to. One can get the result from CSelectionManager. In most cases, select to group 1; since group 0 is reserved for current selection. |
box | region in world position |
pFnctFilter | a callback function to further filter selected object. if it is NULL, any scene object could be selected. |
select object on root tile
add all visitor biped objects, only the last time will have this list non-empty
breadth first transversing the scene(the root tile is ignored) pTile is now the root tile. object attached to it are never rendered directly
add other tiles
rough culling algorithm using the quad tree terrain tiles test against a sphere round the eye
go down the quad tree terrain tile to render objects
even we know that the tile is empty, we still need to see if there is anything in the queueNode for rendering so when both queue are empty, we can exit the main rendering transversing loop
We will not push objects in the current terrain tile to a queue object for further view clipping.
add all solid objects to the queue for further testing
add all visitor biped objects to the queue.
add all free space objects to the queue
For any potentially visible objects in the queue, perform further object-level clipping test, and draw them if the test passes.
int ParaEngine::CSceneObject::SelectObject | ( | int | nGroupIndex, |
const CShapeSphere & | circle, | ||
OBJECT_FILTER_CALLBACK | pFnctFilter = NULL |
||
) |
select object on root tile
add all visitor biped objects, only the last time will have this list non-empty
breadth first transversing the scene(the root tile is ignored) pTile is now the root tile. object attached to it are never rendered directly
add other tiles
rough culling algorithm using the quad tree terrain tiles test against a sphere round the eye
go down the quad tree terrain tile to render objects
even we know that the tile is empty, we still need to see if there is anything in the queueNode for rendering so when both queue are empty, we can exit the main rendering transversing loop
We will not push objects in the current terrain tile to a queue object for further view clipping.
add all solid objects to the queue for further testing
add all visitor biped objects to the queue.
add all free space objects to the queue
For any potentially visible objects in the queue, perform further object-level clipping test, and draw them if the test passes.
|
virtual |
set the color of the scene ground when it is not enabled.When scene is enabled, the background color is always the fog color.
Implements ParaEngine::IScene.
void CSceneObject::SetCurrentActor | ( | CBaseObject * | pActor | ) |
Set the actor that is being processed by the AI module or a script call back.
The pointer can be NULL.
void CSceneObject::SetCursor | ( | const char * | szCursorFile, |
int | nHotSpotX = -1 , |
||
int | nHotSpotY = -1 |
||
) |
Set/Get cursor file when mouse is over it.
If empty, the parent cursor file is used.
void CSceneObject::SetEnvironmentSim | ( | IEnvironmentSim * | pSim | ) |
set the environment simulator to be used with this world.
void CSceneObject::SetForceExportPhysics | ( | bool | bWhetherPhysicsAreAlwaysExported | ) |
set whether physics of MeshPhysicsObject is always exported regardless of per object settings.
void CSceneObject::SetFullscreenGlowBlendingFactor | ( | float | fGlowFactor | ) |
full screen glow effect is parameterized by the blending weight of the source image and the glow image.
the blending weights are given by
fGlowFactor | : default value is 0.5 |
void CSceneObject::SetFullscreenGlowIntensity | ( | float | fGlowIntensity | ) |
full screen glow effect is parameterized by the blending weight of the source image and the glow image.
the blending weights are given by
fGlowIntensity | : default value is 2 |
void CSceneObject::SetMaxCharTriangles | ( | int | nNum | ) |
set max number of character triangles allowed.
we render characters from front to back. and if the previously drawn character count exceed this value we will stop rendering the rest of the characters. this value defaults to 50000
void CSceneObject::SetMaximumNumShadowCasters | ( | int | nNum | ) |
set the maximum number of shadow casters.
void CSceneObject::SetMaximumNumShadowReceivers | ( | int | nNum | ) |
set the maximum number of shadow receivers.
void CSceneObject::SetMaxLocalLightsNum | ( | int | nNum | ) |
set maximum number of local lights per object.
nNum | must be smaller than some internal value, currently its upper limit is 8 |
void CSceneObject::SetMaxRenderCount | ( | int | nRenderImportance, |
int | nCount | ||
) |
set the max number of objects to be rendered of a given render importance.
One can set the render importance of any objects by setting its "RenderImportance" property
nRenderImportance | the render importance to set. All objects are by default set with render importance 0. |
nCount | the max number to set for the above render importance. |
|
inline |
the mouse ray picking distance for onclick event.
usually 30-100 meters
void CSceneObject::SetPhysicsDebugDrawMode | ( | int | nMode | ) |
set the physics debug draw mode.
it is a bitwise field of PhysicsDebugDrawModes
nMode | 0 to disable it. -1(0xffff) to enable full debug mode drawing for current physics. |
|
virtual |
whether render shadow
call this function turn on/off shadow rendering once for all
Reimplemented from ParaEngine::IScene.
void CSceneObject::SetShadowMapTexelSize | ( | int | nWidth, |
int | nHeight | ||
) |
Set the size of the shadow map.
void CSceneObject::SetShadowMapTexelSizeLevel | ( | int | nLevel | ) |
Set the size level of the shadow map.
nLevel | 0 means 1024 texels; 1 means 1536 texels. default is level 0. |
CBaseObject * CSceneObject::TogglePlayer | ( | ) |
It changes the current player to the next player in the scene.
this function is mostly for testing and game purpose. if the object has a reference object, the reference object will become the current object. return : the new current player is returned.
bool CSceneObject::UnLoadFlashTextures | ( | ) |
unload all flash textures.
this is sometimes used to close music and delete all flash windows.
void CSceneObject::UnloadObjectResources | ( | CBaseObject * | pObject | ) |
unload the resources used by the specified object.
If it is a physics object, it will be removed from the physics world.
void CSceneObject::UpdateOcean | ( | ) |
call this function, when the ocean has changed or the environment has changed.
This will cause the reflection map of the ocean surface to redraw regardless of whether the camera moves or not.
|
protected |
whether to use instancing during scene rendering.
it is disabled by default.
|
protected |
dead objects pool.
|
protected |
the mouse ray picking distance for onclick event.
usually 30-100 meters
|
protected |
a list of missile objects.
Missile objects will always be tested for rendered on a per-frame basis.
|
protected |
default to -1, which is using current hardware value.
|
protected |
default to -1, which is using current hardware value.
|
protected |
physics world
for drawing line based debug object.
|
protected |
the cursor to be displayed when mouse over it.
If this is empty, the parent cursor is used.
|
protected |
it keeps a reference to all active (sentient) game objects in the scene.