#include <vpBody.h>
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 Inertia & | GetInertia (void) const |
| void | SetJointFrame (vpJoint *J, const SE3 &T) |
| const SE3 & | GetJointFrame (const vpJoint *) const |
| void | SetFrame (const SE3 &) |
| const SE3 & | GetFrame (void) const |
| void | SetGenVelocity (const se3 &) |
| void | SetGenVelocityLocal (const se3 &) |
| void | SetGenAcceleration (const se3 &) |
| void | SetGenAccelerationLocal (const se3 &) |
| se3 | GetGenVelocity (void) const |
| const se3 & | GetGenVelocityLocal (void) const |
| Vec3 | GetLinVelocity (const Vec3 &p) const |
| Vec3 | GetAngVelocity (void) const |
| se3 | GetGenAcceleration (void) const |
| const se3 & | GetGenAccelerationLocal (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 vpMaterial * | GetMaterial (void) const |
| const Vec3 & | GetCenterOfMass (void) const |
| void | GenerateDisplayList (bool) |
| dse3 | GetForce (void) const |
| const dse3 & | GetNetForce (void) const |
| dse3 | GetGravityForce (void) const |
| bool | IsSetInertia (void) const |
| int | GetNumGeometry (void) const |
| const vpGeom * | GetGeometry (int) const |
| int | GetID (void) const |
| void | SetGround (bool=true) |
| void | ApplyGravity (bool flag=true) |
| bool | IsApplyingGravity (void) const |
| const vpWorld * | GetWorld (void) const |
| bool | DetectCollisionApprox (const vpBody *pBody) const |
set up a joint to the body.
| J | a joint that you want to connect to the body | |
| T | transformation of the joint frame represented in a body frame. |
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().
| 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. |
apply a force to the body.
| 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.
set a transformation of the joint frame.
| J | the joint should be set to the body previously using SetJoint() method. |
| VP_INLINE void vpBody::SetFrame | ( | const SE3 & | T | ) |
| 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.
get a linear velocity of a given point in the body. The velocity is reprenseted in a global frame.
| 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.
Add a primitive geometry to the body
| pGeom | a pointer to a primitive geometry | |
| T | a location of the geometry represented in the body frame. |
| 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.
| VP_INLINE const vpMaterial * vpBody::GetMaterial | ( | void | ) | const |
get a meterial applied to the body.
| 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
| VP_INLINE int vpBody::GetNumGeometry | ( | void | ) | const |
get a number of geometries attached to the body
| 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.
| void vpBody::ApplyGravity | ( | bool | flag = true |
) |
Apply gravity for the body.
| bool vpBody::IsApplyingGravity | ( | void | ) | const |
return wheter the gravity is applied to the body
| VP_INLINE const vpWorld * vpBody::GetWorld | ( | void | ) | const |
return the world including with the body
| VP_INLINE bool vpBody::DetectCollisionApprox | ( | const vpBody * | pBody | ) | const |
return whether the body is collided with pBody approximated with bounding sphere
1.5.5