Couch
Public Member Functions | Friends | List of all members
Rigidbody Class Reference

#include <Rigidbody.h>

Inheritance diagram for Rigidbody:
Inheritance graph
[legend]
Collaboration diagram for Rigidbody:
Collaboration graph
[legend]

Public Member Functions

virtual void Translate (Vector3 offset)
 
void SetCollisionShape (CollisionShape collisionShape)
 
float GetMass ()
 
void SetMass (float mass)
 
void ApplyImpulse (Vector3 impulse)
 
void ApplyForce (Vector3 force)
 
bool GetCharacter ()
 
void SetCharacter (bool character)
 
virtual RigidbodyCreate ()
 
virtual RigidbodyDuplicate ()
 
virtual RigidbodyInstance ()
 
- Public Member Functions inherited from Spatial
virtual Name GetType () const
 
Transform GetTransform ()
 
void SetTransform (Transform transform)
 
Transform GetGlobalTransform ()
 
void SetGlobalTransform (Transform globalTransform)
 
void RotateX (float phi)
 
void RotateY (float phi)
 
void RotateZ (float phi)
 
void UniformScale (float scale)
 
- Public Member Functions inherited from Node
 Node (bool isPrefab)
 
bool IsPrefab ()
 
NodeList GetChildren ()
 
void AddChild (Node *child)
 
NodeGetParent ()
 
void QueueFree ()
 
void DoFree ()
 

Friends

class World
 

Additional Inherited Members

- Static Public Member Functions inherited from Node
static NodeGetRoot ()
 

Detailed Description

Rigidbodies are any body that interacts with the physics bodies

Member Function Documentation

◆ ApplyForce()

void Rigidbody::ApplyForce ( Vector3  force)

Add a force to this object, scaled to the time step. Can be called every update.

Parameters
The(unscaled) force

◆ ApplyImpulse()

void Rigidbody::ApplyImpulse ( Vector3  impulse)

Add an instantaneous impulse to the object. Probably shouldn't be called every update.

Parameters
impulseThe impulse vector

◆ Create()

Rigidbody * Rigidbody::Create ( )
virtual

Allocates a new "default" version of this node.

Returns
A reference to the node.

Reimplemented from Spatial.

◆ Duplicate()

Rigidbody * Rigidbody::Duplicate ( )
virtual

Copies the properties of this node to a newly allocated node, created via Create. Subclasses should override this to copy additional class attributes

Returns
A reference to the duplicate

Reimplemented from Spatial.

◆ GetCharacter()

bool Rigidbody::GetCharacter ( )

If this is a character object, meaning it's rotation is not controlled by the physics engine

Returns
true if this is a character object

◆ GetMass()

float Rigidbody::GetMass ( )

Gets the mass of this rigidbody

Returns
The mass, 0.0 if this is an infinite mass object

◆ Instance()

Rigidbody * Rigidbody::Instance ( )
virtual

Creates an instanced version of this node, by calling Duplicate. Subclasses should override this to perform neccesary tasks for instantiation, i.e. adding a physic object to the physics world. Any children of this node will also be instanced.

Returns
an instanced version of this node.

Reimplemented from Spatial.

◆ SetCharacter()

void Rigidbody::SetCharacter ( bool  character)

Sets if this object's rotation is controlled by the physics engine

Parameters
charactertrue if this is a character object

◆ SetCollisionShape()

void Rigidbody::SetCollisionShape ( CollisionShape  collisionShape)

Sets the collision shape of this rigidbody

Parameters
collisionShapeThe collision shape

◆ SetMass()

void Rigidbody::SetMass ( float  mass)

Sets the mass of this rigidbody. Note that setting mass equal to 0.0 will make it an infinite mass object

Parameters
massThe desired mass

◆ Translate()

void Rigidbody::Translate ( Vector3  offset)
virtual

Directly translate this physics object.

Parameters
offsetThe desired translation offset.

Reimplemented from Spatial.


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