My Project
BaseObject.h
1 #pragma once
2 #include "IAttributeFields.h"
3 #include "IViewClippingObject.h"
4 #include "IRefObject.h"
5 #include "IHeadOn3D.h"
6 #include "IObjectScriptingInterface.h"
7 #include <list>
8 #include <vector>
9 #include "unordered_ref_array.h"
10 #include "EffectFileHandles.h"
11 #include "ObjectEvent.h"
12 
13 namespace ParaEngine
14 {
15 class IParaDebugDraw;
16 
42 {
61  OBJ_VOLUMN_VIP = 0x1<<5,
65  VOLUMN_MASK = 0x7f,
67  MESH_USE_LIGHT = 0x1<<7,
75  MESH_VEGETATION= 0x1<<11,
84  OBJ_SKIP_RENDER = 0x1<<14,
87  OBJ_SKIP_PICKING = 0x1<<15,
91  /* whether the object will be rendered with a custom renderer. The default draw function will do nothing. */
92  OBJ_CUSTOM_RENDERER = 0x1 << 17,
93 };
94 
107 };
108 
113 {
114  _undefined = 0,
116  _Floor = 2,
117  _Sky = 3,
120  _Scene = 5,
121  _LocalLight = 6,
122 
125  _PC_Portal=8,
126  _PC_AntiPortal=9,
127 
129  _Tile = 20,
130 
131  _Sensor = 22,
132  _House = 23,
134  _SolidHouse = 24,
143  // voxel mesh from a 3d grid.
144  _VoxelMesh = 29,
145 
151  _Biped = 40,
159  _NPC=50,
161 
167  _Team,
168  _Creature,
169  _Player,
170  _RPG, // typical RPG object
171  _UnknownGlobal,
172 
175  _CameraThirdPerson=101,
176  _CameraFirstPerson=102,
177 };
178 
181 {
188 };
189 
190 
191 struct AssetEntity;
231 {
232 public:
234 
235  // typedef std::list<CBaseObject*> CChildObjectList_Type;
237  typedef std::list<ObjectEvent> ObjectEventList_Type;
238 
239  enum _SceneObjectType
240  {
241  BaseObject = 0,
242  ContainerObject = 0x1,
243  MeshObject = 0x1<<1,
244  SkyMesh = 0x1<<2,
245  BipedObject = 0x1<<3,
246  SpriteObject = 0x1<<4,
247  SceneRoot = 0x1<<5,
248  OPCBiped = 0x1<<6,
249  RPGBiped = 0x1<<7,
250  MDXObject = 0x1<<8,
251  MeshPhysicsObject = 0x1<<9,
252  DynamicObject = 0x1<<10,
253  ViewCullingObject = 0x1<<11,
254  MissileObject = 0x1<<12,
255  GameObject = 0x1<<13,
256  LightObject = 0x1<<14,
257  MiniSceneGraph = 0x1<<15,
258  VoxelMesh = 0x1<<16,
259  ManagedLoader = 0x1<<17,
260  ZoneNode = 0x1<<18,
261  PortalNode = 0x1<<19,
262  AntiPortalNode = 0x1<<20,
263  CadObject = 0x1<<21,
264  };
265  virtual CBaseObject::_SceneObjectType GetType(){return CBaseObject::BaseObject;};
266 
269  Type_EnterSentientArea=0,
270  Type_LeaveSentientArea,
271  Type_Click,
272  Type_Event,
273  Type_Perception,
274  Type_FrameMove,
275  Type_Net_Send,
276  Type_Net_Receive,
277  Type_OnLoadScript,
278  Type_OnAssetLoaded,
279  Type_Paint,
280  Type_Unknown,
281  };
282 
290  NPL_UPDATE = 0x1<<2,
292  NPL_DELETE = 0x1<<3,
295  };
296  CBaseObject(void);
297  virtual ~CBaseObject(void);
298 
309  virtual void Clone(CBaseObject* obj);
310 
317  virtual CBaseObject* Clone();
318 
319 
323  virtual std::string ToString(DWORD nMethod);
324 
329  int GetID();
330 
332  static CBaseObject* GetObjectByID(int nID);
333 
335  // implementation of IAttributeFields
336 
338  virtual int GetAttributeClassID(){return ATTRIBUTE_CLASSID_CBaseObject;}
340  virtual const char* GetAttributeClassName(){static const char name[] = "CBaseObject"; return name;}
342  virtual const char* GetAttributeClassDescription(){static const char desc[] = ""; return desc;}
344  virtual int InstallFields(CAttributeClass* pClass, bool bOverride);
345 
347  virtual bool AddChildAttributeObject(IAttributeFields* pChild, int nRowIndex = -1, int nColumnIndex = 0);
348 
352  virtual void* QueryObjectByName(const std::string& sObjectType);
353 
357  virtual void* QueryObject(int nObjectType);
358 
359  ATTRIBUTE_METHOD1(CBaseObject, GetID_s, int*) { *p1 = cls->GetID(); return S_OK; }
360 
361  ATTRIBUTE_METHOD1(CBaseObject, IsGlobal_s, bool*) {*p1 = cls->IsGlobal(); return S_OK;}
362 
363  ATTRIBUTE_METHOD1(CBaseObject, GetFacing_s, float*) {*p1 = cls->GetFacing(); return S_OK;}
364  ATTRIBUTE_METHOD1(CBaseObject, SetFacing_s, float) {cls->SetFacing(p1); return S_OK;}
365 
366  ATTRIBUTE_METHOD1(CBaseObject, GetYaw_s, float*) { *p1 = cls->GetYaw(); return S_OK; }
367  ATTRIBUTE_METHOD1(CBaseObject, SetYaw_s, float) { cls->SetYaw(p1); return S_OK; }
368 
369  ATTRIBUTE_METHOD1(CBaseObject, GetPitch_s, float*) { *p1 = cls->GetPitch(); return S_OK; }
370  ATTRIBUTE_METHOD1(CBaseObject, SetPitch_s, float) { cls->SetPitch(p1); return S_OK; }
371 
372  ATTRIBUTE_METHOD1(CBaseObject, GetRoll_s, float*) { *p1 = cls->GetRoll(); return S_OK; }
373  ATTRIBUTE_METHOD1(CBaseObject, SetRoll_s, float) { cls->SetRoll(p1); return S_OK; }
374 
375  ATTRIBUTE_METHOD1(CBaseObject, GetHeight_s, float*) {*p1 = cls->GetHeight(); return S_OK;}
376  ATTRIBUTE_METHOD1(CBaseObject, SetHeight_s, float) {cls->SetHeight(p1); return S_OK;}
377 
378  ATTRIBUTE_METHOD1(CBaseObject, GetWidth_s, float*) {*p1 = cls->GetWidth(); return S_OK;}
379  ATTRIBUTE_METHOD1(CBaseObject, SetWidth_s, float) {cls->SetWidth(p1); return S_OK;}
380 
381  ATTRIBUTE_METHOD1(CBaseObject, GetDepth_s, float*) {*p1 = cls->GetDepth(); return S_OK;}
382  ATTRIBUTE_METHOD1(CBaseObject, SetDepth_s, float) {cls->SetDepth(p1); return S_OK;}
383 
384  ATTRIBUTE_METHOD1(CBaseObject, GetRadius_s, float*) {*p1 = cls->GetRadius(); return S_OK;}
385  ATTRIBUTE_METHOD1(CBaseObject, SetRadius_s, float) {cls->SetRadius(p1); return S_OK;}
386 
387  ATTRIBUTE_METHOD1(CBaseObject, GetPosition_s, DVector3*) { *p1 = cls->GetPosition(); return S_OK; }
388  ATTRIBUTE_METHOD1(CBaseObject, SetPosition_s, DVector3) { cls->SetPosition(p1); return S_OK; }
389 
390  ATTRIBUTE_METHOD1(CBaseObject, GetAssetFileName_s, const char**) { *p1 = cls->GetAssetFileName().c_str(); return S_OK; }
391  ATTRIBUTE_METHOD1(CBaseObject, SetAssetFileName_s, const char*) { cls->SetAssetFileName(p1); return S_OK; }
392 
393  ATTRIBUTE_METHOD1(CBaseObject, GetTechHandle_s, int*) {*p1 = cls->GetPrimaryTechniqueHandle(); return S_OK;}
394  ATTRIBUTE_METHOD1(CBaseObject, SetTechHandle_s, int) {cls->SetPrimaryTechniqueHandle(p1); return S_OK;}
395 
396  ATTRIBUTE_METHOD1(CBaseObject, GetCtorPercentage_s, float*) {*p1 = cls->GetCtorPercentage(); return S_OK;}
397  ATTRIBUTE_METHOD1(CBaseObject, SetCtorPercentage_s, float) {cls->SetCtorPercentage(p1); return S_OK;}
398 
399  ATTRIBUTE_METHOD1(CBaseObject, GetHomeZone_s, const char**) {*p1 = cls->GetHomeZoneName(); return S_OK;}
400  ATTRIBUTE_METHOD1(CBaseObject, SetHomeZone_s, const char*) {cls->SetHomeZoneName(p1); return S_OK;}
401 
402  ATTRIBUTE_METHOD1(CBaseObject, GetShowBoundingBox_s, bool*) {*p1 = cls->IsShowBoundingBox(); return S_OK;}
403  ATTRIBUTE_METHOD1(CBaseObject, SetShowBoundingBox_s, bool) {cls->ShowBoundingBox(p1); return S_OK;}
404 
405  ATTRIBUTE_METHOD1(CBaseObject, GetPhysicsGroup_s, int*) {*p1 = cls->GetPhysicsGroup(); return S_OK;}
406  ATTRIBUTE_METHOD1(CBaseObject, SetPhysicsGroup_s, int) {cls->SetPhysicsGroup(p1); return S_OK;}
407 
408  ATTRIBUTE_METHOD1(CBaseObject, GetPhysicsGroupMask_s, DWORD*) {*p1 = cls->GetPhysicsGroupMask(); return S_OK;}
409  ATTRIBUTE_METHOD1(CBaseObject, SetPhysicsGroupMask_s, DWORD) {cls->SetPhysicsGroupMask(p1); return S_OK;}
410 
411  ATTRIBUTE_METHOD1(CBaseObject, GetSelectGroupIndex_s, int*) {*p1 = cls->GetSelectGroupIndex(); return S_OK;}
412  ATTRIBUTE_METHOD1(CBaseObject, SetSelectGroupIndex_s, int) {cls->SetSelectGroupIndex(p1); return S_OK;}
413 
414  ATTRIBUTE_METHOD(CBaseObject, Reset_s) {cls->Reset(); return S_OK;}
415 
416  DEFINE_SCRIPT_EVENT_GET(CBaseObject, OnAssetLoaded);
417  ATTRIBUTE_METHOD1(CBaseObject, SetOnAssetLoaded_s, const char*) {cls->SetOnAssetLoaded(p1); return S_OK;}
418 
419  ATTRIBUTE_METHOD1(CBaseObject, GetRenderOrder_s, float*) { *p1 = cls->GetRenderOrder(); return S_OK; }
420  ATTRIBUTE_METHOD1(CBaseObject, SetRenderOrder_s, float) { cls->SetRenderOrder(p1); return S_OK; }
421 
422  ATTRIBUTE_METHOD1(CBaseObject, GetRenderImportance_s, int*) { *p1 = cls->GetRenderImportance(); return S_OK; }
423  ATTRIBUTE_METHOD1(CBaseObject, SetRenderImportance_s, int) { cls->SetRenderImportance(p1); return S_OK; }
424 
425  ATTRIBUTE_METHOD1(CBaseObject, GetRenderDistance_s, float*) {*p1 = cls->GetRenderDistance(); return S_OK;}
426  ATTRIBUTE_METHOD1(CBaseObject, SetRenderDistance_s, float) {cls->SetRenderDistance(p1); return S_OK;}
427 
428  ATTRIBUTE_METHOD1(CBaseObject, GetAnimation_s, int*) {*p1 = cls->GetAnimation(); return S_OK;}
429  ATTRIBUTE_METHOD1(CBaseObject, SetAnimation_s, int) {cls->SetAnimation(p1); return S_OK;}
430 
431  ATTRIBUTE_METHOD1(CBaseObject, GetAnimFrame_s, int*) {*p1 = cls->GetAnimFrame(); return S_OK;}
432  ATTRIBUTE_METHOD1(CBaseObject, SetAnimFrame_s, int) {cls->SetAnimFrame(p1); return S_OK;}
433 
434  ATTRIBUTE_METHOD1(CBaseObject, IsAnimEnabled_s, bool*) { *p1 = cls->IsAnimEnabled(); return S_OK; }
435  ATTRIBUTE_METHOD1(CBaseObject, EnableAnim_s, bool) { cls->EnableAnim(p1); return S_OK; }
436 
437  ATTRIBUTE_METHOD1(CBaseObject, IsUseGlobalTime_s, bool*) {*p1 = cls->IsUseGlobalTime(); return S_OK;}
438  ATTRIBUTE_METHOD1(CBaseObject, SetUseGlobalTime_s, bool) {cls->SetUseGlobalTime(p1); return S_OK;}
439 
440  ATTRIBUTE_METHOD1(CBaseObject, GetChildCount_s, int*) {*p1 = (int)(cls->GetChildren().size()); return S_OK;}
441 
442  ATTRIBUTE_METHOD1(CBaseObject, GetNormal_s, Vector3*) {*p1 = cls->GetNormal(); return S_OK;}
443  ATTRIBUTE_METHOD1(CBaseObject, SetNormal_s, Vector3) {cls->SetNormal(p1); return S_OK;}
444 
445  ATTRIBUTE_METHOD1(CBaseObject, IsTransparent_s, bool*) {*p1 = cls->IsTransparent(); return S_OK;}
446  ATTRIBUTE_METHOD1(CBaseObject, SetTransparent_s, bool) {cls->SetTransparent(p1); return S_OK;}
447 
448  ATTRIBUTE_METHOD1(CBaseObject, IsVisible_s, bool*) {*p1 = cls->IsVisible(); return S_OK;}
449  ATTRIBUTE_METHOD1(CBaseObject, SetVisibility_s, bool) {cls->SetVisibility(p1); return S_OK;}
450 
451  ATTRIBUTE_METHOD1(CBaseObject, IsShadowCaster_s, bool*) {*p1 = cls->IsShadowCaster(); return S_OK;}
452  ATTRIBUTE_METHOD1(CBaseObject, SetShadowCaster_s, bool) {cls->SetShadowCaster(p1); return S_OK;}
453 
454  ATTRIBUTE_METHOD1(CBaseObject, IsShadowReceiver_s, bool*) {*p1 = cls->IsShadowReceiver(); return S_OK;}
455  ATTRIBUTE_METHOD1(CBaseObject, SetShadowReceiver_s, bool) {cls->SetShadowReceiver(p1); return S_OK;}
456 
457  ATTRIBUTE_METHOD1(CBaseObject, IsBillboarded_s, bool*) {*p1 = cls->IsBillboarded(); return S_OK;}
458  ATTRIBUTE_METHOD1(CBaseObject, SetBillboarded_s, bool) {cls->SetBillboarded(p1); return S_OK;}
459 
460  ATTRIBUTE_METHOD1(CBaseObject, IsSkipRender_s, bool*) {*p1 = cls->IsSkipRender(); return S_OK;}
461  ATTRIBUTE_METHOD1(CBaseObject, SetSkipRender_s, bool) {cls->SetSkipRender(p1); return S_OK;}
462 
463  ATTRIBUTE_METHOD1(CBaseObject, IsSkipPicking_s, bool*) {*p1 = cls->IsSkipPicking(); return S_OK;}
464  ATTRIBUTE_METHOD1(CBaseObject, SetSkipPicking_s, bool) {cls->SetSkipPicking(p1); return S_OK;}
465 
466  ATTRIBUTE_METHOD1(CBaseObject, IsSkipTerrainNormal_s, bool*) {*p1 = cls->IsSkipTerrainNormal(); return S_OK;}
467  ATTRIBUTE_METHOD1(CBaseObject, SetSkipTerrainNormal_s, bool) {cls->SetSkipTerrainNormal(p1); return S_OK;}
468 
469  ATTRIBUTE_METHOD1(CBaseObject, GetSelectionEffect_s, int*) {*p1 = cls->GetSelectionEffect(); return S_OK;}
470  ATTRIBUTE_METHOD1(CBaseObject, SetSelectionEffect_s, int) {cls->SetSelectionEffect(p1); return S_OK;}
471 
472  ATTRIBUTE_METHOD1(CBaseObject, IsHeadOnZEnabled_s, bool*) {*p1 = cls->IsHeadOnZEnabled(); return S_OK;}
473  ATTRIBUTE_METHOD1(CBaseObject, SetHeadOnZEnabled_s, bool) {cls->SetHeadOnZEnabled(p1); return S_OK;}
474 
475  ATTRIBUTE_METHOD1(CBaseObject, IsHeadOn3DScalingEnabled_s, bool*) {*p1 = cls->IsHeadOn3DScalingEnabled(); return S_OK;}
476  ATTRIBUTE_METHOD1(CBaseObject, SetHeadOn3DScalingEnabled_s, bool) {cls->SetHeadOn3DScalingEnabled(p1); return S_OK;}
477 
478  ATTRIBUTE_METHOD1(CBaseObject, IsHeadOnUseGlobal3DScaling_s, bool*) {*p1 = cls->IsHeadOnUseGlobal3DScaling(); return S_OK;}
479  ATTRIBUTE_METHOD1(CBaseObject, SetHeadOnUseGlobal3DScaling_s, bool) {cls->SetHeadOnUseGlobal3DScaling(p1); return S_OK;}
480 
481  ATTRIBUTE_METHOD1(CBaseObject, GetHeadOnNearZoomDist_s, float*) {*p1 = cls->GetHeadOnNearZoomDist(); return S_OK;}
482  ATTRIBUTE_METHOD1(CBaseObject, SetHeadOnNearZoomDist_s, float) {cls->SetHeadOnNearZoomDist(p1); return S_OK;}
483 
484  ATTRIBUTE_METHOD1(CBaseObject, GetHeadOnFarZoomDist_s, float*) {*p1 = cls->GetHeadOnFarZoomDist(); return S_OK;}
485  ATTRIBUTE_METHOD1(CBaseObject, SetHeadOnFarZoomDist_s, float) {cls->SetHeadOnFarZoomDist(p1); return S_OK;}
486 
487  ATTRIBUTE_METHOD1(CBaseObject, GetHeadOnMinUIScaling_s, float*) {*p1 = cls->GetHeadOnMinUIScaling(); return S_OK;}
488  ATTRIBUTE_METHOD1(CBaseObject, SetHeadOnMinUIScaling_s, float) {cls->SetHeadOnMinUIScaling(p1); return S_OK;}
489 
490  ATTRIBUTE_METHOD1(CBaseObject, GetHeadOnMaxUIScaling_s, float*) {*p1 = cls->GetHeadOnMaxUIScaling(); return S_OK;}
491  ATTRIBUTE_METHOD1(CBaseObject, SetHeadOnMaxUIScaling_s, float) {cls->SetHeadOnMaxUIScaling(p1); return S_OK;}
492 
493  ATTRIBUTE_METHOD1(CBaseObject, GetHeadOnAlphaFadePercentage_s, float*) {*p1 = cls->GetHeadOnAlphaFadePercentage(); return S_OK;}
494  ATTRIBUTE_METHOD1(CBaseObject, SetHeadOnAlphaFadePercentage_s, float) {cls->SetHeadOnAlphaFadePercentage(p1); return S_OK;}
495 
496  ATTRIBUTE_METHOD1(CBaseObject, GetHeadOn3DFacing_s, float*) {*p1 = cls->GetHeadOn3DFacing(); return S_OK;}
497  ATTRIBUTE_METHOD1(CBaseObject, SetHeadOn3DFacing_s, float) {cls->SetHeadOn3DFacing(p1); return S_OK;}
498 
499  ATTRIBUTE_METHOD1(CBaseObject, IsPersistent_s, bool*) {*p1 = cls->IsPersistent(); return S_OK;}
500  ATTRIBUTE_METHOD1(CBaseObject, SetPersistent_s, bool) {cls->SetPersistent(p1); return S_OK;}
501 
502  ATTRIBUTE_METHOD1(CBaseObject, IsDead_s, bool*) { *p1 = cls->IsDead(); return S_OK; }
503  ATTRIBUTE_METHOD1(CBaseObject, SetDead_s, bool) { cls->SetDead(); return S_OK; }
504 
505  ATTRIBUTE_METHOD1(CBaseObject, IsTileObject_s, bool*) { *p1 = cls->IsTileObject(); return S_OK; }
506  ATTRIBUTE_METHOD1(CBaseObject, SetTileObject_s, bool) { cls->SetTileObject(p1); return S_OK; }
507 
508  ATTRIBUTE_METHOD1(CBaseObject, GetFrameNumber_s, int*) { *p1 = cls->GetFrameNumber(); return S_OK; }
509  ATTRIBUTE_METHOD1(CBaseObject, SetFrameNumber_s, int) { cls->SetFrameNumber(p1); return S_OK; }
510 
511  ATTRIBUTE_METHOD1(CBaseObject, GetOpacity_s, float*) { *p1 = cls->GetOpacity(); return S_OK; }
512  ATTRIBUTE_METHOD1(CBaseObject, SetOpacity_s, float) { cls->SetOpacity(p1); return S_OK; }
513 
514  ATTRIBUTE_METHOD1(CBaseObject, IsLastFrameRendered_s, bool*) { *p1 = cls->IsLastFrameRendered(); return S_OK; }
515  ATTRIBUTE_METHOD(CBaseObject, DestroyChildren_s) { cls->DestroyChildren(); return S_OK; }
516 
517  ATTRIBUTE_METHOD1(CBaseObject, GetRenderMatrix_s, Matrix4*) { cls->GetRenderMatrix(*p1); return S_OK; }
518 
519  ATTRIBUTE_METHOD1(CBaseObject, SetLocalTransform_s, const Matrix4&) { cls->SetLocalTransform(p1); return S_OK; }
520  ATTRIBUTE_METHOD1(CBaseObject, GetLocalTransform_s, Matrix4*) { cls->GetLocalTransform(p1); return S_OK; }
521 
522  ATTRIBUTE_METHOD1(CBaseObject, IsPhysicsEnabled_s, bool*) { *p1 = cls->IsPhysicsEnabled(); return S_OK; }
523  ATTRIBUTE_METHOD1(CBaseObject, EnablePhysics_s, bool) { cls->EnablePhysics(p1); return S_OK; }
524 
525  ATTRIBUTE_METHOD1(CBaseObject, IsLODEnabled_s, bool*) { *p1 = cls->IsLODEnabled(); return S_OK; }
526  ATTRIBUTE_METHOD1(CBaseObject, EnableLOD_s, bool) { cls->EnableLOD(p1); return S_OK; }
527 
529  virtual IAttributeFields* GetChildAttributeObject(const std::string& sName);
531  virtual int GetChildAttributeObjectCount(int nColumnIndex = 0);
533  virtual int GetChildAttributeColumnCount();
534  virtual IAttributeFields* GetChildAttributeObject(int nRowIndex, int nColumnIndex = 0);
535 public:
536 
538  virtual bool IsGlobal();
539  inline bool IsBiped(){return m_objType>=_Biped;};
540 
542  virtual IGameObject* QueryIGameObject();
543  virtual IAttributeFields* GetAttributeObject();
544 
546  inline bool CheckVolumnField(DWORD volType){ return CheckAttribute(volType);};
547 
548  virtual TextureEntity* GetTexture();
549 
555  inline bool CheckAttribute(DWORD attribute){
556  return (m_dwAttribute & attribute)>0;
557  }
563  inline void SetAttribute(DWORD dwAtt, bool bTurnOn = true){
564  if(bTurnOn)
565  m_dwAttribute |= dwAtt;
566  else
567  m_dwAttribute &= (~dwAtt);
568  }
569 
573  inline void SetBillboarded(bool bBillboarded){
574  SetAttribute(MESH_BILLBOARDED, bBillboarded);
575  }
580  inline bool IsBillboarded(){
582  }
583 
587  inline void SetShadowReceiver(bool bEnable){
589  }
590 
595  inline bool IsShadowReceiver(){
597  }
598 
603  inline void SetShadowCaster(bool bEnable){
605  }
606 
610  inline bool IsShadowCaster(){
612  }
613 
615  inline void SetVegetation(bool bIsVegetation)
616  {
617  SetAttribute(MESH_VEGETATION, bIsVegetation);
618  }
619 
621  inline bool IsVegetation(){
623  }
624 
628  inline void ShowBoundingBox(bool bShowBoundingBox){
629  SetAttribute(OBJ_SHOW_BOUNDINGBOX, bShowBoundingBox);
630  }
634  inline bool IsShowBoundingBox(){
636  }
637 
640 
644  void SetHomeZone(CZoneNode* pZone);
645 
647  bool IsVisible();
649  void SetVisibility(bool bVisible);
650 
652  inline bool IsRenderable()
653  {
655  }
656 
658  inline void SetSkipRender(bool bSkipRender){
659  SetAttribute(OBJ_SKIP_RENDER, bSkipRender);
660  }
661 
663  inline bool IsSkipRender(){
665  }
666 
668  inline void SetSkipPicking(bool bSkipPicking){
669  SetAttribute(OBJ_SKIP_PICKING, bSkipPicking);
670  }
671 
673  inline bool IsSkipPicking(){
675  }
676 
680  void SetSkipTerrainNormal(bool bSkip);
681 
685  bool IsSkipTerrainNormal();
686 
688  bool CanPick();
689 
691  virtual bool CanHasPhysics();
695  virtual void LoadPhysics();
696 
700  virtual void UnloadPhysics();
701 
703  virtual void EnablePhysics(bool bEnable);
704 
708  virtual void SetAlwaysLoadPhysics(bool bEnable);
709 
710  virtual bool IsPhysicsEnabled();
711 
715  virtual bool ViewTouch();
716 
721  inline void SetRenderImportance(int nRenderImportance) {m_nRenderImportance = nRenderImportance;}
722  inline int GetRenderImportance() {return m_nRenderImportance;}
723 
733  float GetRenderOrder() const { return m_fRenderOrder; }
734  void SetRenderOrder(float val);
735 
737  CChildObjectList_Type& GetChildren(){ return m_children;};
738 
742  CBaseObject* GetChildByName(const string& name, bool bRecursive = false);
743 
748  virtual void DestroyChildren();
749 
754  int DestroyChildByName(const string& name, bool bRecursive = false);
755 
760  int RemoveChildByName(const string& name, bool bRecursive = false);
761 
766  int RemoveChild(const CBaseObject* pObj, bool bRecursive = false);
767 
769  virtual void SetOnAssetLoaded(const char* sCallbackScript);
770 
771 
779  bool ActivateScript(int func_type, const string& precode, const string& postcode);
780  bool ActivateScript(int func_type, const string& precode);
781  bool ActivateScript(int func_type);
782 
792  virtual void SetBoundingBox(float fOBB_X, float fOBB_Y, float fOBB_Z, float fFacing);
793 
797  virtual void GetBoundingBox(float* fOBB_X, float* fOBB_Y, float* fOBB_Z, float* fFacing);
798 
806  virtual void SetBoundRect(float fWidth ,float fHeight, float fFacing);
810  virtual void GetBoundRect(float* fWidth ,float* fHeight, float* fFacing);
811 
816  virtual void SetRadius(float fRadius);
817 
821  virtual float GetRadius();
822 
826  virtual int GetSelectionEffect();
827 
831  virtual void SetSelectionEffect(int nStyle);
832 
836  virtual bool IsPersistent();
840  virtual void SetPersistent(bool bPersistent);
841 
842  virtual void SetOpacity(float fOpacity);
843  virtual float GetOpacity();
844 
845  virtual HRESULT InitDeviceObjects(); // device independent
846  virtual HRESULT RestoreDeviceObjects(); // device dependent
847  virtual HRESULT InvalidateDeviceObjects();
848  virtual HRESULT DeleteDeviceObjects();
849  virtual HRESULT RendererRecreated();
850 public:
853  virtual float GetRenderDistance();
854  virtual void SetRenderDistance(float fDist);
855 
864  virtual int GetPrimaryTechniqueHandle();
865 
873  virtual void SetPrimaryTechniqueHandle(int nHandle);
874 
878  virtual CParameterBlock* GetEffectParamBlock(bool bCreateIfNotExist = false);
879 
885  virtual bool IsTransparent(){return false;};
886 
891  virtual void SetTransparent(bool bIsTransparent){};
892 
900  virtual int GetNumReplaceableTextures();
901 
908  virtual TextureEntity* GetDefaultReplaceableTexture(int ReplaceableTextureID);
909 
918  virtual TextureEntity* GetReplaceableTexture(int ReplaceableTextureID);
919 
929  virtual bool SetReplaceableTexture(int ReplaceableTextureID, TextureEntity* pTextureEntity);
930 
935  virtual void OnSelect(int nGroupID);
937  virtual void OnDeSelect();
938 
940  virtual void AddChild(CBaseObject * pObject);
945  virtual void SetParent(CBaseObject* pParent) {};
946  virtual CBaseObject* GetParent() { return NULL; };
947 
953  virtual bool IsDead();
954  virtual void SetDead();
955 
958  virtual void AddToDeadObjectPool();
959 
961  virtual void Cleanup(){};
967  virtual void Animate( double dTimeDelta, int nRenderNumber=0 );
969  virtual HRESULT Draw( SceneState * sceneState);
974  virtual int PrepareRender(CBaseCamera* pCamera, SceneState * sceneState);
975 
983  virtual Matrix4* GetAttachmentMatrix(Matrix4& pOut, int nAttachmentID=0, int nRenderNumber=0);
984 
988  virtual bool HasAttachmentPoint( int nAttachmentID=0);
989 
996  virtual Vector3* GetAttachmentPosition(Vector3& pOut, int nAttachmentID=0, int nRenderNumber=0);
997 
1003  virtual CBipedStateManager* GetBipedStateManager(bool bCreateOnDemand = true) {return NULL;};
1004 
1011  virtual void SetPhysicsGroup(int nGroup){};
1012 
1020  virtual int GetPhysicsGroup(){return 0;};
1021 
1024  virtual void SetAnimation(int nAnimID){};
1025 
1027  virtual void SetPhysicsGroupMask(DWORD dwValue);
1028 
1030  virtual DWORD GetPhysicsGroupMask();
1031 
1033  virtual int GetAnimation(){return 0;};
1034 
1038  virtual void SetAnimFrame(int nFrame){};
1039 
1041  virtual int GetAnimFrame(){return 0;};
1042 
1044  virtual void EnableAnim(bool bAnimated) {};
1045  virtual bool IsAnimEnabled() { return true; };
1046 
1052  virtual void SetUseGlobalTime(bool bUseGlobalTime){};
1053 
1059  virtual bool IsUseGlobalTime(){return false;};
1060 
1062  virtual float GetPhysicsRadius();
1063 
1065  virtual void Reset(){};
1066 
1068  virtual DVector3 GetPosition();
1069 
1071  virtual void SetPosition(const DVector3 & v);
1072 
1074  virtual float GetHeight();
1075  virtual void SetHeight(float fHeight);
1076 
1078  virtual float GetWidth();
1079  virtual void SetWidth(float fWidth);
1080 
1082  virtual float GetDepth();
1083  virtual void SetDepth(float fDepth);
1084 
1085  /* return the normal at the terrain position where the object is situated at its x,z plane.*/
1086  virtual Vector3 GetNormal();
1087  virtual void SetNormal(const Vector3 & pNorm){};
1088 
1094  virtual void PushParam();
1095 
1101  virtual void PopParam();
1102 
1108  /*virtual void SetScaling(float x, float y, float z){};
1109  virtual void GetScaling(float& x, float& y, float& z){x=1.f;y=1.f;z=1.f;};*/
1110 
1112  virtual AssetEntity* GetPrimaryAsset(){return NULL;};
1113 
1115  virtual const std::string& GetAssetFileName();
1116 
1118  virtual void SetAssetFileName(const std::string& sFilename);
1119 
1120  virtual bool IsStanding(){return true;};
1121 
1124  virtual float GetCtorPercentage(){return 1.0f;}
1127  virtual void SetCtorPercentage(float fPercentage){}
1128 
1133  virtual void AutoSelectTechnique();
1134 
1135  virtual void Report( vector < string > & v_sReport );
1136  virtual HRESULT ResetTime();
1137 
1141  virtual bool HasAlphaBlendedObjects();
1142 
1143  enum CompressOption{
1144  ReleaseDevices = 1,
1145  ReleasePhysics = 2,
1146  ReleaseEvents = 4
1147  };
1153  virtual void CompressObject(CompressOption option = (CompressOption)0xffff);
1154 
1159 
1165  virtual void UpdateFrameNumber(int nFrameNumber);
1166  void SetFrameNumber(int nFrameNumber);
1167 
1169  int GetFrameNumber();
1170 
1173  bool CheckFrameNumber(int nFrameNumber);
1174 
1176  bool IsLastFrameRendered();
1177 
1182  void SetMyType(ObjectType t);
1183  ObjectType GetMyType();
1184 
1189  void SnapToTerrainSurface(bool bUseNorm = true);
1190 
1192  virtual ObjectShape GetObjectShape();
1193 
1195  virtual void SetObjectShape(ObjectShape shape);
1196 
1199  virtual void SetTileContainer(CTerrainTile* val);
1202  virtual void UpdateTileContainer();
1203 
1205  void SetHomeZoneName(const char* sName);
1206  const char* GetHomeZoneName();
1207 
1211  void SetSelectGroupIndex(int nGroupIndex = -1);
1212 
1214  int GetSelectGroupIndex();
1215 
1219  virtual bool IsTileObject();
1220  virtual void SetTileObject(bool bIsTileObject);
1221 
1222 
1224  inline bool IsGeometryDirty() const { return m_bGeometryDirty; }
1225  void SetGeometryDirty(bool bDirty = true);
1226 
1228  bool IsLODEnabled() const;
1229  void EnableLOD(bool val);
1230 
1232  virtual void UpdateGeometry();
1233 
1235  virtual void SetLocalTransform(const Matrix4& mXForm);
1237  virtual void GetLocalTransform(Matrix4* localTransform);
1238 
1240  virtual int GetMeshTriangleList(std::vector<Vector3>& output, int nOption = 0);
1241 
1242 protected:
1244  int m_nID;
1245 
1248 
1250  CChildObjectList_Type m_children;
1251 
1254 
1255 
1256  // the quad-tree terrain tile that this game object is currently visiting. This may be NULL, if object has not been attached.
1257  CTerrainTile* m_tileContainer;
1258 
1261 
1264 
1267 
1273 
1284 
1288 
1291 
1295  bool m_bEnableLOD : 1;
1298 };
1299 }
Which DXT Compression to Use? Obviously, there are some trade-offs between the different formats whic...
Definition: TextureEntity.h:29
virtual bool SetReplaceableTexture(int ReplaceableTextureID, TextureEntity *pTextureEntity)
set the replaceable texture at the given index with a new texture.
Definition: BaseObject.cpp:741
virtual int InstallFields(CAttributeClass *pClass, bool bOverride)
this class should be implemented if one wants to add new attribute.
Definition: BaseObject.cpp:1128
void SetSelectGroupIndex(int nGroupIndex=-1)
set the selection group index.
Definition: BaseObject.cpp:59
bool m_bEnableLOD
whether to enable lod if there is lod.
Definition: BaseObject.h:1295
Update the object in NPL, which is delete the object first, then create it again. this is useful to u...
Definition: BaseObject.h:290
virtual bool HasAlphaBlendedObjects()
return true if the object contains alpha blended render pass.
Definition: BaseObject.cpp:926
virtual void SetObjectShape(ObjectShape shape)
set the object shape
Definition: BaseObject.cpp:400
bool IsSkipPicking()
get whether object should be excluded from picking.
Definition: BaseObject.h:673
virtual int GetAnimFrame()
get the current animation frame number relative to the beginning of current animation.
Definition: BaseObject.h:1041
float m_fRenderDistance
we will not render this object if the object&#39;s position to camera eye position is further than this v...
Definition: BaseObject.h:1287
virtual void OnSelect(int nGroupID)
called when an object is selected.
Definition: BaseObject.cpp:464
this is a very big and non-movable object.
Definition: BaseObject.h:80
virtual bool HasAttachmentPoint(int nAttachmentID=0)
whether it has an attachment point
Definition: BaseObject.cpp:655
3-dimensional vector with double precision.
Definition: ParaDVector3.h:17
int32 m_nTechniqueHandle
the primary technique handle
Definition: BaseObject.h:1260
an attribute class is a collection of attribute fields.
Definition: AttributeClass.h:10
virtual void SetPosition(const DVector3 &v)
always bottom center of the bounding shape
Definition: BaseObject.cpp:942
virtual void SetPrimaryTechniqueHandle(int nHandle)
Set a new render technique handle.
Definition: BaseObject.cpp:430
It&#39;s used as parameter to Draw method of each scene object.
Definition: SceneState.h:284
virtual float GetRadius()
Definition: BaseObject.cpp:272
delete the object in NPL
Definition: BaseObject.h:292
all child objects are in this object&#39;s volume
Definition: BaseObject.h:47
virtual void SetLocalTransform(const Matrix4 &mXForm)
set local transform directly
Definition: BaseObject.cpp:1076
create the object in NPL
Definition: BaseObject.h:286
two solid objects with sensor volume will cause environment simulator to to generate sensor/collision...
Definition: BaseObject.h:45
int RemoveChildByName(const string &name, bool bRecursive=false)
remove a child by name but it does not destroy it.
Definition: BaseObject.cpp:560
virtual bool IsPersistent()
whether the object is persistent in the world.
Definition: BaseObject.cpp:835
bool IsGeometryDirty() const
whether the shape of the object is dirty, such as model, size, facing, local transform is changed...
Definition: BaseObject.h:1224
Pure interface for CBaseObject (3D scene object) It defines basic shapes and collision detection...
Definition: IViewClippingObject.h:29
DWORD m_dwAttribute
volume type and attribute of this object.
Definition: BaseObject.h:1247
Controllable only through LLE(commands) from the network.
Definition: BaseObject.h:166
virtual void SetAlwaysLoadPhysics(bool bEnable)
by default physics is lazy-load when player walk into its bounding box, setting this to false will al...
Definition: BaseObject.cpp:766
virtual void EnableAnim(bool bAnimated)
whether animation is enabled.
Definition: BaseObject.h:1044
CChildObjectList_Type m_children
child objects array: we keep strong references (ref counted) to child objects
Definition: BaseObject.h:1250
virtual void SetUseGlobalTime(bool bUseGlobalTime)
whether to use global time to sync animation.
Definition: BaseObject.h:1052
virtual void Reset()
reset the object to its default settings.
Definition: BaseObject.h:1065
whether to suppress the asset creation code.
Definition: BaseObject.h:294
bool CheckVolumnField(DWORD volType)
Use CheckAttribute()
Definition: BaseObject.h:546
virtual bool AddChildAttributeObject(IAttributeFields *pChild, int nRowIndex=-1, int nColumnIndex=0)
add child object.
Definition: BaseObject.cpp:1081
whether lights have effects on this object.
Definition: BaseObject.h:67
animated mesh object that DOES collide with other object, such as wall and trees. ...
Definition: BaseObject.h:157
int GetID()
the ID of the object.
Definition: BaseObject.cpp:79
bool IsBillboarded()
if the model asset file name ended with "_b" it will be treated as billboarded.
Definition: BaseObject.h:580
virtual int GetAttributeClassID()
attribute class ID should be identical, unless one knows how overriding rules work.
Definition: BaseObject.h:338
void SetVisibility(bool bVisible)
set the visibility of this object.
Definition: BaseObject.cpp:380
virtual AssetEntity * GetPrimaryAsset()
Set scaling.
Definition: BaseObject.h:1112
int32 m_nFrameNumber
the frame number that this object is last accessed.
Definition: BaseObject.h:1263
void SetVegetation(bool bIsVegetation)
whether to render this mesh using the vegetation shader
Definition: BaseObject.h:615
virtual const std::string & GetAssetFileName()
get asset file name
Definition: BaseObject.cpp:307
virtual void * QueryObjectByName(const std::string &sObjectType)
convert to object of a given type.
Definition: BaseObject.cpp:1095
a yellow border around the biped.
Definition: BaseObject.h:185
bool IsLODEnabled() const
whether to enable lod if there is lod.
Definition: BaseObject.cpp:899
virtual void SetPhysicsGroupMask(DWORD dwValue)
set groups Mask used to filter physics objects, default to 0xffffffff
Definition: BaseObject.cpp:826
different physics engine has different winding order.
Definition: EventBinding.h:32
CZoneNode * GetHomeZone()
get the home zone of this object if any.
Definition: BaseObject.cpp:687
virtual void SetTransparent(bool bIsTransparent)
Set whether the object is transparent.
Definition: BaseObject.h:891
int GetFrameNumber()
get the frame number that this object is last accessed.
Definition: BaseObject.cpp:845
bool IsVegetation()
whether to render this mesh using the vegetation shader
Definition: BaseObject.h:621
virtual int GetPhysicsGroup()
Get the physics group ID to which this object belongs to default to 0, must be smaller than 32...
Definition: BaseObject.h:1020
bool IsVisible()
invisible object will not be drawn.
Definition: BaseObject.cpp:390
virtual ObjectShape GetObjectShape()
get the object shape
Definition: BaseObject.cpp:395
virtual void PushParam()
Usually, this is used in canvas drawing.
Definition: BaseObject.cpp:358
void SetAttribute(DWORD dwAtt, bool bTurnOn=true)
enable or disable a given attribute.
Definition: BaseObject.h:563
virtual int GetChildAttributeColumnCount()
we support multi-dimensional child object.
Definition: BaseObject.cpp:962
virtual void CompressObject(CompressOption option=(CompressOption) 0xffff)
Compress the object to save memory.
Definition: BaseObject.cpp:241
OBJECT_ATTRIBUTE
object volume bit fields here is some example: scene root: OBJ_VOLUMN_ISOLATED | OBJ_VOLUMN_FREESPAC...
Definition: BaseObject.h:41
virtual void SetCtorPercentage(float fPercentage)
Set the object construction percentage (progress) in the range[0,1].
Definition: BaseObject.h:1127
whether it is not a shadow caster.
Definition: BaseObject.h:73
virtual void UnloadPhysics()
load the physics object
Definition: BaseObject.cpp:375
virtual DWORD GetPhysicsGroupMask()
get groups Mask used to filter physics objects, default to 0xffffffff
Definition: BaseObject.cpp:830
portal rendering object
Definition: BaseObject.h:124
virtual void UpdateFrameNumber(int nFrameNumber)
this function is called to update the render frame number of this object.
Definition: BaseObject.cpp:726
virtual int GetSelectionEffect()
get the render effect when character is in selected state.
Definition: BaseObject.cpp:796
virtual void GetLocalTransform(Matrix4 *localTransform)
get local transform
Definition: BaseObject.cpp:1017
extensions for HAPI creation, main terrain mesh(can be very large)
Definition: BaseObject.h:119
virtual void SetAnimFrame(int nFrame)
set the current animation frame number relative to the beginning of current animation.
Definition: BaseObject.h:1038
this object is should be skipped early during render queue building.
Definition: BaseObject.h:84
virtual void DestroyChildren()
Completely destroy child nodes from memory recursively.
Definition: BaseObject.cpp:233
virtual CParameterBlock * GetEffectParamBlock(bool bCreateIfNotExist=false)
get effect parameter block with this object.
Definition: BaseObject.cpp:636
whether it is a vegetation.
Definition: BaseObject.h:75
virtual std::string ToString(DWORD nMethod)
convert the object to an NPL string by which this object may be created or deleted.
Definition: BaseObject.cpp:201
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 boundin...
Definition: BaseObject.cpp:245
virtual bool IsGlobal()
whether this object is global.
Definition: BaseObject.cpp:105
virtual TextureEntity * GetDefaultReplaceableTexture(int ReplaceableTextureID)
get the default replaceable texture by its ID.
Definition: BaseObject.cpp:756
virtual void * QueryObject(int nObjectType)
convert to object of a given type.
Definition: BaseObject.cpp:1103
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
solid objects(like biped) can be placed on its volume, provided it&#39;s not already occupied by any soli...
Definition: BaseObject.h:51
bool IsRenderable()
whether this object can be rendered.
Definition: BaseObject.h:652
virtual bool ViewTouch()
this function is called, when the object is in view range.
Definition: BaseObject.cpp:776
whether show bounding box.
Definition: BaseObject.h:77
virtual void SetPhysicsGroup(int nGroup)
set the physics group ID to which this object belongs to default to 0, must be smaller than 32...
Definition: BaseObject.h:1011
void SetHomeZone(CZoneNode *pZone)
set the home zone of this object if any.
Definition: BaseObject.cpp:695
ObjectShape
object shape
Definition: IViewClippingObject.h:13
Definition: BaseCamera.h:70
bool IsShadowReceiver()
if the model asset file name ended with "_r" it will be treated as shadow receiver.
Definition: BaseObject.h:595
virtual CBipedStateManager * GetBipedStateManager(bool bCreateOnDemand=true)
get biped state manager
Definition: BaseObject.h:1003
void SnapToTerrainSurface(bool bUseNorm=true)
call this function to reset the y component and norm of the object to the global terrain surface at (...
Definition: BaseObject.cpp:332
float m_fRenderOrder
0 if automatic, larger number renders after smaller numbered object.
Definition: BaseObject.h:1283
int32 m_nSelectGroupIndex
this is the selection group index.
Definition: BaseObject.h:1266
virtual void GetBoundRect(float *fWidth, float *fHeight, float *fFacing)
Definition: BaseObject.cpp:261
void ShowBoundingBox(bool bShowBoundingBox)
set whether to show bounding box for this object.
Definition: BaseObject.h:628
virtual bool IsTileObject()
if true, we will attach this object to quad-tree terrain tile according to its attributes when adding...
Definition: BaseObject.cpp:69
int GetSelectGroupIndex()
get the selection group index.
Definition: BaseObject.cpp:64
bool IsShadowCaster()
Definition: BaseObject.h:610
void SetRenderImportance(int nRenderImportance)
the larger, the more important.
Definition: BaseObject.h:721
virtual TextureEntity * GetReplaceableTexture(int ReplaceableTextureID)
get the current replaceable texture by its ID.
Definition: BaseObject.cpp:746
virtual float GetPhysicsRadius()
get the radius for physics simulation.
Definition: BaseObject.cpp:276
virtual Vector3 * GetAttachmentPosition(Vector3 &pOut, int nAttachmentID=0, int nRenderNumber=0)
whether it has an attachment point
Definition: BaseObject.cpp:661
a zone in portal rendering.
Definition: ZoneNode.h:17
CParameterBlock * m_pEffectParamBlock
effect param block that should be applied to m_nTechniqueHandle
Definition: BaseObject.h:1290
virtual bool CanHasPhysics()
if the object may contain physics
Definition: BaseObject.cpp:811
virtual void LoadPhysics()
load the physics objects.
Definition: BaseObject.cpp:370
void SetHomeZoneName(const char *sName)
set the home zone name.
Definition: BaseObject.cpp:710
void SetSkipRender(bool bSkipRender)
set whether object should be excluded from the skip render
Definition: BaseObject.h:658
int DestroyChildByName(const string &name, bool bRecursive=false)
destroy a child by name.
Definition: BaseObject.cpp:522
objects with this VIP volume type will trigger the plot of the scene in its view-culling radius...
Definition: BaseObject.h:61
this is an interface class for game objects, such as NPC, OPC and players.
Definition: IGameObject.h:15
virtual HRESULT Draw(SceneState *sceneState)
only for drawable objects
Definition: BaseObject.cpp:351
virtual bool IsTransparent()
whether the object contains transparent material.
Definition: BaseObject.h:885
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: ParaMatrix4.h:23
virtual void PopParam()
Usually, this is used in canvas drawing.
Definition: BaseObject.cpp:364
solid mesh such as simple houses, stone, etc
Definition: BaseObject.h:138
a tile in the latticed terrain class
Definition: TerrainTile.h:21
virtual void SetOnAssetLoaded(const char *sCallbackScript)
set the callback script whenever the primary asset is successfully loaded.
Definition: BaseObject.cpp:91
bool CheckFrameNumber(int nFrameNumber)
call this function whenever a render may render this object.
Definition: BaseObject.cpp:731
mask of the above bits.
Definition: BaseObject.h:65
CBaseObject * GetChildByName(const string &name, bool bRecursive=false)
get child by name: it may return NULL if the child does not exist.
Definition: BaseObject.cpp:490
virtual void SetParent(CBaseObject *pParent)
this function is called by parent class to set the child&#39;s parent.
Definition: BaseObject.h:945
virtual float GetRenderDistance()
we will not render this object if the object&#39;s position to camera eye position is further than this v...
Definition: BaseObject.cpp:791
int32 m_nRenderImportance
the larger, the more important.
Definition: BaseObject.h:1272
virtual void SetAssetFileName(const std::string &sFilename)
set asset file name
Definition: BaseObject.cpp:316
if this bit is on, the object&#39;s physics data is read from the mesh entity (i.e.
Definition: BaseObject.h:106
create the object in managed loader in NPL
Definition: BaseObject.h:288
int m_nID
the ID of the object.
Definition: BaseObject.h:1244
bool IsShowBoundingBox()
get whether to show bounding box for this object.
Definition: BaseObject.h:634
virtual int GetMeshTriangleList(std::vector< Vector3 > &output, int nOption=0)
return triangle list
Definition: BaseObject.cpp:1025
A common interface for all classes implementing IAttributeFields By implementing this class&#39;s virtual...
Definition: IAttributeFields.h:59
CallBackType
call back type
Definition: BaseObject.h:268
virtual float GetDepth()
get object depth: z axis
Definition: BaseObject.cpp:298
CTerrainTile * GetTileContainer()
get the quad-tree terrain tile that this game object is currently visiting.
Definition: BaseObject.cpp:409
virtual void UpdateTileContainer()
update the tile container according to the current position of the game object.
Definition: BaseObject.cpp:419
virtual void UpdateGeometry()
this function is usually called after asset file has changed.
Definition: BaseObject.cpp:1071
virtual IAttributeFields * GetChildAttributeObject(const std::string &sName)
get attribute by child object.
Definition: BaseObject.cpp:888
virtual const char * GetAttributeClassDescription()
a static string, describing the attribute class object
Definition: BaseObject.h:342
animated mesh object that does not collide with any object, such as bird and grass ...
Definition: BaseObject.h:155
bool IsSkipTerrainNormal()
if specified, this character will always be perpendicular to the ground, regardless to the terrain no...
Definition: BaseObject.cpp:821
virtual int GetNumReplaceableTextures()
get the total number of replaceable textures, which is the largest replaceable texture ID...
Definition: BaseObject.cpp:751
bool IsSkipRender()
get whether object should be excluded from the render queue.
Definition: BaseObject.h:663
PHYSICS_METHOD
how physics is implemented in this object.
Definition: BaseObject.h:96
above this value must be drawn
Definition: BaseObject.h:129
virtual Matrix4 * GetAttachmentMatrix(Matrix4 &pOut, int nAttachmentID=0, int nRenderNumber=0)
Get the specified attachment matrix of the current model.
Definition: BaseObject.cpp:650
virtual void SetSelectionEffect(int nStyle)
get the render effect when character is in selected state.
Definition: BaseObject.cpp:801
void SetSkipPicking(bool bSkipPicking)
set whether object should be excluded from picking
Definition: BaseObject.h:668
CCameraObject.
Definition: BaseObject.h:174
virtual void SetAnimation(int nAnimID)
Set the current animation id.
Definition: BaseObject.h:1024
void SetShadowReceiver(bool bEnable)
Definition: BaseObject.h:587
this object should be skipped in all picking functions.
Definition: BaseObject.h:87
below are all Neuron objects
Definition: BaseObject.h:160
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 boun...
Definition: BaseObject.cpp:257
above this value are all global bipeds, as apposed to regional biped
Definition: BaseObject.h:163
load physics when this object is created.
Definition: BaseObject.h:101
virtual void GetBoundingBox(float *fOBB_X, float *fOBB_Y, float *fOBB_Z, float *fFacing)
Definition: BaseObject.cpp:249
virtual void Cleanup()
clean up the object.
Definition: BaseObject.h:961
void SetBillboarded(bool bBillboarded)
Definition: BaseObject.h:573
virtual int GetChildAttributeObjectCount(int nColumnIndex=0)
get the number of child objects (row count) in the given column.
Definition: BaseObject.cpp:921
bool CanPick()
get whether object can be picked by mouse picking.
Definition: BaseObject.cpp:806
this object has no physics.
Definition: BaseObject.h:103
if specified, this character will always be perpendicular to the ground, regardless to the terrain no...
Definition: BaseObject.h:90
ObjectType m_objType
type of the object
Definition: BaseObject.h:1253
static int g_nObjectSelectionEffect
enum of RenderSelectionStyle
Definition: BaseObject.h:1297
virtual const char * GetAttributeClassName()
a static string, describing the attribute class object&#39;s name
Definition: BaseObject.h:340
mini scene graph
Definition: BaseObject.h:142
virtual IGameObject * QueryIGameObject()
this may return NULL, if the object does not implement the IGameObject interface. ...
Definition: BaseObject.cpp:404
RenderSelectionStyle
how to render a selected object
Definition: BaseObject.h:180
managing biped state
Definition: BipedStateManager.h:11
virtual CBaseObject * Clone()
Clone the object&#39;s contains and return a pointer to the newly created object.
Definition: BaseObject.cpp:1121
Definition: IObjectScriptingInterface.h:6
virtual void Animate(double dTimeDelta, int nRenderNumber=0)
animate the model by a given delta time.
Definition: BaseObject.cpp:211
virtual float GetHeight()
get object height y axis: only for object that has a Height property, usually is height of the boundi...
Definition: BaseObject.cpp:280
only load physics when a dynamic physics object enters its bounding box.
Definition: BaseObject.h:99
void SetShadowCaster(bool bEnable)
set whether it is shadow caster.
Definition: BaseObject.h:603
virtual bool IsDead()
whether this object should be removed some time in the future.
Definition: BaseObject.cpp:952
float GetRenderOrder() const
0 if automatic, larger number renders after smaller numbered object.
Definition: BaseObject.h:733
Defines the base class of all scene elements:CBaseObject for Parallel World Engine.
Definition: BaseObject.h:230
Dummy mesh that does not collide with any object, such as grass,etc.
Definition: BaseObject.h:140
virtual void SetRadius(float fRadius)
Set the object shape to Sphere and sphere parameters.
Definition: BaseObject.cpp:268
Object invisible, the object is not drawn.but its physics may load. added by lxz 2006.3.5.
Definition: BaseObject.h:63
virtual int PrepareRender(CBaseCamera *pCamera, SceneState *sceneState)
derived class can override this function to place the object in to the render pipeline.
Definition: BaseObject.cpp:931
void SetMyType(ObjectType t)
set the type of the object, it tells what this object is used for.
Definition: BaseObject.cpp:159
virtual float GetCtorPercentage()
Get the object construction percentage (progress) in the range[0,1].
Definition: BaseObject.h:1124
ObjectType
type of the scene objects
Definition: BaseObject.h:112
NPL_STRING
by which method an object is converted to NPL string.
Definition: BaseObject.h:284
CBaseObject.
Definition: BaseObject.h:116
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.
Definition: BaseObject.cpp:957
just appear brighter without applying light effect and diffuse color is 1.
Definition: BaseObject.h:183
virtual float GetWidth()
get object width: x axis
Definition: BaseObject.cpp:289
extensions for HAPI creation, added 2004-4-30 by LiXizhi
Definition: BaseObject.h:134
extensions for HAPI creation, added 2004-5-20 by LiXizhi
Definition: BaseObject.h:136
Some 3d object may contain some head on display objects.
Definition: IHeadOn3D.h:84
the object has a perceptive radius that may be larger than the object&#39;s collision radius...
Definition: BaseObject.h:59
whether the object is isolated from its siblings.
Definition: BaseObject.h:56
CChildObjectList_Type & GetChildren()
– Base object functions
Definition: BaseObject.h:737
static CBaseObject * GetObjectByID(int nID)
GetObject By ID.
Definition: BaseObject.cpp:96
whether to rotate the object around Y axis to let the object always facing the camera.
Definition: BaseObject.h:69
whether it is a shadow receiver.
Definition: BaseObject.h:71
bool m_bGeometryDirty
whether the shape of the object is dirty, such as model, size, facing, local transform is changed...
Definition: BaseObject.h:1293
below are types of animation object that at least derived from CBipedObject and is animatable...
Definition: BaseObject.h:153
virtual int GetPrimaryTechniqueHandle()
when batch-rendering a group of objects, objects are usually sorted by their render techniques and th...
Definition: BaseObject.cpp:425
virtual void AutoSelectTechnique()
automatically select the proper technique for the rendering of the object.
Definition: BaseObject.cpp:435
virtual void AddChild(CBaseObject *pObject)
add another object as the child of this object
Definition: BaseObject.cpp:215
void SetSkipTerrainNormal(bool bSkip)
if specified, this character will always be perpendicular to the ground, regardless to the terrain no...
Definition: BaseObject.cpp:816
virtual void SetPersistent(bool bPersistent)
whenever a persistent object is made non-persistent, the SaveToDB() function will actually removed it...
Definition: BaseObject.cpp:840
virtual IViewClippingObject * GetViewClippingObject()
return the view clipping object used for object-level clipping when rendering this object...
Definition: BaseObject.cpp:850
virtual void OnDeSelect()
called whenever an object is un-selected.
Definition: BaseObject.cpp:476
virtual void EnablePhysics(bool bEnable)
this function will turn on or off the physics of the object.
Definition: BaseObject.cpp:761
int RemoveChild(const CBaseObject *pObj, bool bRecursive=false)
remove a child by pointer but it does not destroy it.
Definition: BaseObject.cpp:598
Base class for managed asset entity in ParaEngine.
Definition: AssetEntity.h:25
bool IsLastFrameRendered()
check to see if the last frame is rendered.
Definition: BaseObject.cpp:857
bool CheckAttribute(DWORD attribute)
whether an object attribute is enabled.
Definition: BaseObject.h:555
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...
Definition: BaseObject.cpp:111
flashing the biped. Not implemented.
Definition: BaseObject.h:187
virtual int GetAnimation()
get the scaling.
Definition: BaseObject.h:1033
a list of CParameter{name, value} pairs of anything.
Definition: ParameterBlock.h:108
virtual DVector3 GetPosition()
always bottom center of the bounding shape
Definition: BaseObject.cpp:937
virtual bool IsUseGlobalTime()
whether to use global time to sync animation.
Definition: BaseObject.h:1059