PhysicsFeature::PhysicsProperty Class Reference
#include <physicsproperty.h>
Inherited by PhysicsFeature::ActorPhysicsProperty.
Detailed Description
A physics property adds basic physical behaviour to a game entity. The default behaviour is that of a passive physics object which will just passively roll and bounce around. Implement more advanced behaviour in subclasses.The physics property maintains the attributes:
Attr::Transform Attr::Velocity
(C) 2005 Radon Labs GmbH
Public Member Functions | |
PhysicsProperty () | |
constructor | |
virtual | ~PhysicsProperty () |
destructor | |
virtual void | SetupCallbacks () |
setup callbacks for this property | |
virtual void | SetupDefaultAttributes () |
setup default entity attributes | |
virtual void | OnActivate () |
called from Entity::ActivateProperties() | |
virtual void | OnDeactivate () |
called from Entity::DeactivateProperties() | |
virtual void | SetupAcceptedMessages () |
override to register accepted messages | |
virtual void | HandleMessage (const Ptr< Messaging::Message > &msg) |
handle a single message | |
virtual void | OnMoveAfter () |
called after movement has happened | |
virtual Physics::PhysicsEntity * | GetPhysicsEntity () const |
get a pointer to the physics entity | |
void | SetEnabled (bool enabled) |
enable/disable physics | |
bool | IsEnabled () const |
is physics enabled | |
Protected Member Functions | |
virtual void | EnablePhysics () |
enable and activate the physics, overload in subclass | |
virtual void | DisablePhysics () |
disable and cleanup the physics, overload in subclass | |
void | ApplyImpulseAtPos (const Math::vector &impulse, const Math::vector &pos, bool multByMass=false) |
apply a global impulse vector at the next time step at a global position |
Member Function Documentation
void PhysicsFeature::PhysicsProperty::OnActivate | ( | ) | [virtual] |
called from Entity::ActivateProperties()
Called when property is attached to a game entity. This will create and setup the required physics entities.
void PhysicsFeature::PhysicsProperty::OnDeactivate | ( | ) | [virtual] |
called from Entity::DeactivateProperties()
Called when property is going to be removed from its game entity. This will release the physics entity owned by the game entity.
void PhysicsFeature::PhysicsProperty::OnMoveAfter | ( | ) | [virtual] |
called after movement has happened
Called after the physics subsystem has been triggered. This will transfer the physics entity's new transform back into the game entity.
Physics::PhysicsEntity * PhysicsFeature::PhysicsProperty::GetPhysicsEntity | ( | ) | const [virtual] |
get a pointer to the physics entity
Get pointer to physics entity. Note that this method may return 0!
void PhysicsFeature::PhysicsProperty::ApplyImpulseAtPos | ( | const Math::vector & | impulse, | |
const Math::vector & | pos, | |||
bool | multByMass = false | |||
) | [protected] |
apply a global impulse vector at the next time step at a global position
Apply an impulse vector at a position in the global coordinate frame.