VirtualPhysics the realtime dynamics simulation library

vpBody Class Reference

Rigid body. More...

#include <vpBody.h>

List of all members.

Public Member Functions

void SetJoint (vpJoint *J, const SE3 &T=SE3(0))
void ApplyGlobalForce (const dse3 &F, const Vec3 &p)
void ApplyLocalForce (const dse3 &F, const Vec3 &p)
void ResetForce (void)
void SetInertia (const Inertia &)
const InertiaGetInertia (void) const
void SetJointFrame (vpJoint *J, const SE3 &T)
const SE3GetJointFrame (const vpJoint *) const
void SetFrame (const SE3 &)
const SE3GetFrame (void) const
void SetGenVelocity (const se3 &)
void SetGenVelocityLocal (const se3 &)
void SetGenAcceleration (const se3 &)
void SetGenAccelerationLocal (const se3 &)
se3 GetGenVelocity (void) const
const se3GetGenVelocityLocal (void) const
Vec3 GetLinVelocity (const Vec3 &p) const
Vec3 GetAngVelocity (void) const
se3 GetGenAcceleration (void) const
const se3GetGenAccelerationLocal (void) const
bool IsCollidable (void) const
bool IsGround (void) const
void SetCollidable (bool)
void AddGeometry (vpGeom *pGeom, const SE3 &T=SE3(0))
scalar GetBoundingSphereRadius (void) const
void SetMaterial (const vpMaterial *)
const vpMaterialGetMaterial (void) const
const Vec3GetCenterOfMass (void) const
void GenerateDisplayList (bool)
dse3 GetForce (void) const
const dse3GetNetForce (void) const
dse3 GetGravityForce (void) const
bool IsSetInertia (void) const
int GetNumGeometry (void) const
const vpGeomGetGeometry (int) const
int GetID (void) const
void SetGround (bool=true)
void ApplyGravity (bool flag=true)
bool IsApplyingGravity (void) const
const vpWorldGetWorld (void) const
bool DetectCollisionApprox (const vpBody *pBody) const


Detailed Description

vpBody is a class to model rigid bodies Typically vpBody consists of several geometries and can be connected to another body with joints.
Examples:

pendulum.cpp.


Member Function Documentation

void vpBody::SetJoint ( vpJoint J,
const SE3 T = SE3(0) 
)

set up a joint to the body.

Parameters:
J a joint that you want to connect to the body
T transformation of the joint frame represented in a body frame.
Examples:
pendulum.cpp.

VP_INLINE void vpBody::ApplyGlobalForce ( const dse3 F,
const Vec3 p 
)

apply a force to the body. The force will accumulated during the simulation time period. After each simulation step, all the applied forces will be set to be zero. If you do not want accumulating the force, then you should call ResetForce() explicitly, before calling Apply*Force().

Parameters:
F a force that you want to apply to the body. F is represented in a global frame
p an appyling position of the force represented in a body frame.

VP_INLINE void vpBody::ApplyLocalForce ( const dse3 F,
const Vec3 p 
)

apply a force to the body.

Parameters:
F a force that you want to apply to the body. F is represented in a body frame
p an appyling position of the force represented in a body frame.

VP_INLINE void vpBody::ResetForce ( void   ) 

release the force from the body.

void vpBody::SetInertia ( const Inertia  ) 

set an inertia tensor tothe body. Evenif you do not choose an inertia for the body, the inertia will be generated automatically from the geometries consisting the body. However you can override or ignore the generated inertia using this method.

VP_INLINE const Inertia & vpBody::GetInertia ( void   )  const

get an inertia tensor of the body.

void vpBody::SetJointFrame ( vpJoint J,
const SE3 T 
)

set a transformation of the joint frame.

Parameters:
J the joint should be set to the body previously using SetJoint() method.

const SE3& vpBody::GetJointFrame ( const vpJoint  )  const

get a transformation of the joint frame.

VP_INLINE void vpBody::SetFrame ( const SE3 T  ) 

set a transformation of the body frame w.r.t a global frame.

See also:
vpWorld::SetGlobalFrame

VP_INLINE const SE3 & vpBody::GetFrame ( void   )  const

get a transformation of the body frame w.r.t a global frame.

VP_INLINE void vpBody::SetGenVelocity ( const se3 v  ) 

set a generalized velocity of the body. The velocity is reprenseted in a global frame. Note that it depends on the current frame. Hence it should be called before SetFrame().

VP_INLINE void vpBody::SetGenVelocityLocal ( const se3 v  ) 

set a generalized velocity of the body. The velocity is reprenseted in a local frame.

VP_INLINE void vpBody::SetGenAcceleration ( const se3 dv  ) 

set a generalized acceleration of the body. The acceleration is reprenseted in a global frame. Note that it depends on the current frame. Hence it should be called before SetFrame().

VP_INLINE void vpBody::SetGenAccelerationLocal ( const se3 dv  ) 

set a generalized acceleration of the body. The acceleration is reprenseted in a local frame.

VP_INLINE se3 vpBody::GetGenVelocity ( void   )  const

get a generalized velocity of the body. The velocity is reprenseted in a global frame.

VP_INLINE const se3 & vpBody::GetGenVelocityLocal ( void   )  const

get a generalized velocity of the body. The velocity is reprenseted in a local frame.

VP_INLINE Vec3 vpBody::GetLinVelocity ( const Vec3 p  )  const

get a linear velocity of a given point in the body. The velocity is reprenseted in a global frame.

Parameters:
p position of the point in the body. It is represented in the body frame.

VP_INLINE Vec3 vpBody::GetAngVelocity ( void   )  const

get an angular velocity of the body. The velocity is reprenseted in a global frame.

VP_INLINE se3 vpBody::GetGenAcceleration ( void   )  const

get a generalized acceleration of the body. The velocity is reprenseted in a global frame.

VP_INLINE const se3 & vpBody::GetGenAccelerationLocal ( void   )  const

get a generalized acceleration of the body. The velocity is reprenseted in a local frame.

VP_INLINE bool vpBody::IsCollidable ( void   )  const

query whether the body can collide with other bodies.

VP_INLINE bool vpBody::IsGround ( void   )  const

query whether the body is desclared as a ground.

VP_INLINE void vpBody::SetCollidable ( bool  state  ) 

set a collidability of the body.

void vpBody::AddGeometry ( vpGeom pGeom,
const SE3 T = SE3(0) 
)

Add a primitive geometry to the body

Parameters:
pGeom a pointer to a primitive geometry
T a location of the geometry represented in the body frame.
Examples:
pendulum.cpp.

VP_INLINE scalar vpBody::GetBoundingSphereRadius ( void   )  const

get a radius of a bounding sphere including the body, where the center is located at the center of body frame

VP_INLINE void vpBody::SetMaterial ( const vpMaterial pMaterial  ) 

set a material for the body. If you do not set up a material, default material properties will be applied.

See also:
vpMaterial::GetDefaultMaterial()

VP_INLINE const vpMaterial * vpBody::GetMaterial ( void   )  const

get a meterial applied to the body.

See also:
vpBody::SetMaterial()

VP_INLINE const Vec3 & vpBody::GetCenterOfMass ( void   )  const

get a center of mass

void vpBody::GenerateDisplayList ( bool   ) 

generate a display list

dse3 vpBody::GetForce ( void   )  const

get a sum of all forces applied to the body including gravity

const dse3& vpBody::GetNetForce ( void   )  const

get a sum of all forces applied to the body excluding gravity

dse3 vpBody::GetGravityForce ( void   )  const

get a force applied to the body due to the gravity

VP_INLINE bool vpBody::IsSetInertia ( void   )  const

return whether the inertia of the body is assigend by user

See also:
vpBody::SetInertia

VP_INLINE int vpBody::GetNumGeometry ( void   )  const

get a number of geometries attached to the body

See also:
vpBody::GetGeometry()

VP_INLINE const vpGeom * vpBody::GetGeometry ( int  i  )  const

get a pointer to the ith geometry

int vpBody::GetID ( void   )  const

get a unique identifying integer value which is assigned by VirtualPhysics

VP_INLINE void vpBody::SetGround ( bool  flag = true  ) 

set the body as a ground. Bodies set as a ground don't move under any external forces.

Examples:
pendulum.cpp.

void vpBody::ApplyGravity ( bool  flag = true  ) 

Apply gravity for the body.

See also:
vpWorld::SetGravity

bool vpBody::IsApplyingGravity ( void   )  const

return wheter the gravity is applied to the body

See also:
vpBody::ApplyGravity

VP_INLINE const vpWorld * vpBody::GetWorld ( void   )  const

return the world including with the body

See also:
vpWorld::AddBody

VP_INLINE bool vpBody::DetectCollisionApprox ( const vpBody pBody  )  const

return whether the body is collided with pBody approximated with bounding sphere


Generated on Wed Jun 11 23:11:49 2008 for VirtualPhysics by  doxygen 1.5.5