2 #include "BlockEngine/BlockCommon.h" 3 #include "TileObject.h" 23 ATTRIBUTE_METHOD1(
CBlockDynamicObject, GetLifetime_s,
float*) { *p1 = cls->GetLifetime();
return S_OK; }
24 ATTRIBUTE_METHOD1(
CBlockDynamicObject, SetLifetime_s,
float) { cls->SetLifetime(p1);
return S_OK; }
26 ATTRIBUTE_METHOD1(
CBlockDynamicObject, GetFadeOutTime_s,
float*) { *p1 = cls->GetFadeOutTime();
return S_OK; }
27 ATTRIBUTE_METHOD1(
CBlockDynamicObject, SetFadeOutTime_s,
float) { cls->SetFadeOutTime(p1);
return S_OK; }
29 ATTRIBUTE_METHOD1(
CBlockDynamicObject, CanBounce_s,
bool*) { *p1 = cls->CanBounce();
return S_OK; }
30 ATTRIBUTE_METHOD1(
CBlockDynamicObject, SetCanBounce_s,
bool) { cls->SetCanBounce(p1);
return S_OK; }
40 virtual void Animate(
double dTimeDelta,
int nRenderNumber = 0);
48 float GetLifetime()
const {
return m_lifetime; }
49 void SetLifetime(
float val) {
m_lifetime = val; }
51 float GetFadeOutTime()
const {
return m_fade_out_time; }
52 void SetFadeOutTime(
float val) { m_fade_out_time = val; }
56 void SetCanBounce(
bool val) { m_can_bounce = val; }
58 const Vector3& GetSpeed()
const {
return m_vSpeed; }
59 void SetSpeed(
const Vector3& val) { m_vSpeed = val; }
65 virtual void SetDead();
67 bool IsOnGround()
const;
68 void SetOnGround(
bool val);
79 float m_fade_out_time;
89 static float default_min_speed;
90 static float default_surface_decay;
91 static float default_air_decay;
92 static float default_gravity;
93 static float default_speedlost_perbounce;
float m_lifetime
in seconds
Definition: BlockDynamicObject.h:78
3-dimensional vector with double precision.
Definition: ParaDVector3.h:17
an attribute class is a collection of attribute fields.
Definition: AttributeClass.h:10
virtual bool TestCollision(CBaseCamera *pCamera)
check if the object's original shape can be seen via a camera.
Definition: BlockDynamicObject.cpp:35
different physics engine has different winding order.
Definition: EventBinding.h:32
virtual void SetParent(CBaseObject *pParent)
this function is called by parent class to set the child's parent.
Definition: BlockDynamicObject.cpp:41
basic block world coordinate
Definition: BlockCoordinate.h:72
virtual int InstallFields(CAttributeClass *pClass, bool bOverride)
this class should be implemented if one wants to add new attribute.
Definition: BlockDynamicObject.cpp:255
Standard 3-dimensional vector.
Definition: ParaVector3.h:16
Definition: BaseCamera.h:70
bool CanBounce() const
whether the object will bounce when hitting the ground.
Definition: BlockDynamicObject.h:55
virtual void Animate(double dTimeDelta, int nRenderNumber=0)
animate the model by a given delta time.
Definition: BlockDynamicObject.cpp:95
virtual void SetPosition(const DVector3 &v)
always bottom center of the bounding shape
Definition: BlockDynamicObject.cpp:86
Tile Object have position and bounding rect and can usually be attached to quad-tree terrain tile...
Definition: TileObject.h:10
Defines the base class of all scene elements:CBaseObject for Parallel World Engine.
Definition: BaseObject.h:230
virtual bool IsDead()
whether this object should be removed some time in the future.
Definition: BlockDynamicObject.cpp:51
virtual bool IsTileObject()
if true, we will attach this object to quad-tree terrain tile according to its attributes when adding...
Definition: BlockDynamicObject.h:37
Definition: BlockDynamicObject.h:10