![]() |
An open-source, flexible 3D physical simulation framework
|
The class that implements the NodeInterface interface. More...
#include <NodePhysics.h>
Public Member Functions | |
NodePhysics (interfaces::PhysicsInterface *world) | |
Creates a empty node objekt. More... | |
virtual | ~NodePhysics (void) |
Destroys the node in the physical world. More... | |
virtual bool | createNode (interfaces::NodeData *node) |
The method creates an ode node, which properties are given by the NodeData param node. More... | |
virtual void | getPosition (utils::Vector *pos) const |
The method copies the position of the node at the adress of the pointer pos. More... | |
virtual const utils::Vector | setPosition (const utils::Vector &pos, bool move_group) |
The method sets the position of the physical node model to the position of the param. More... | |
virtual void | getRotation (utils::Quaternion *q) const |
The method copies the Quaternion of the physically node at the adress of the Quaternion pointer q. More... | |
virtual const utils::Quaternion | setRotation (const utils::Quaternion &q, bool move_group) |
This method sets the rotation of the physically node. More... | |
virtual void | setWorldObject (interfaces::PhysicsInterface *world) |
This function sets the pointer to the physical world object. More... | |
virtual void | getLinearVelocity (utils::Vector *vel) const |
The method copies the linear velocity of the physically node at the adress of the linear_vel pointer vel. More... | |
virtual void | getAngularVelocity (utils::Vector *vel) const |
The method copies the angular velocity of the physically node at the adress of the angular_vel pointer vel. More... | |
virtual void | getForce (utils::Vector *f) const |
The method copies the force of the physically node at the adress of the force pointer force. More... | |
virtual void | getTorque (utils::Vector *t) const |
The method copies the torque of the physically node at the adress of the torque pointer force. More... | |
virtual const utils::Vector | rotateAtPoint (const utils::Vector &rotation_point, const utils::Quaternion &rotation, bool move_group) |
executes an rotation at a given point and returns the new position of the node More... | |
virtual bool | changeNode (interfaces::NodeData *node) |
This function rebuilds the geom (type, size and mass) of a node. More... | |
virtual void | setLinearVelocity (const utils::Vector &velocity) |
Sets the linear velocity of a node. More... | |
virtual void | setAngularVelocity (const utils::Vector &velocity) |
Sets the angular velocity of a node. More... | |
virtual void | setForce (const utils::Vector &f) |
Sets the force of a node. More... | |
virtual void | setTorque (const utils::Vector &t) |
Sets the torque of a node. More... | |
virtual void | addForce (const utils::Vector &f, const utils::Vector &p) |
Adds a off-center force to a node. More... | |
virtual void | addForce (const utils::Vector &f) |
Adds a force to a node. More... | |
virtual void | addTorque (const utils::Vector &t) |
Adds a torque to a node. More... | |
virtual bool | getGroundContact (void) const |
virtual void | getContactPoints (std::vector< utils::Vector > *contact_points) const |
virtual void | getContactIDs (std::list< interfaces::NodeId > *ids) const |
virtual interfaces::sReal | getGroundContactForce (void) const |
virtual void | setContactParams (interfaces::contact_params &c_params) |
virtual void | addSensor (interfaces::BaseSensor *sensor) |
This function adds a new sensor to the physical node. More... | |
virtual void | removeSensor (interfaces::BaseSensor *sensor) |
virtual void | handleSensorData (bool physics_thread=true) |
This function copies all sensor values to the specific allocated memory. More... | |
virtual void | destroyNode (void) |
destroyes a node from the physics More... | |
virtual void | getMass (interfaces::sReal *mass, interfaces::sReal *inertia=0) const |
virtual const utils::Vector | getContactForce (void) const |
virtual interfaces::sReal | getCollisionDepth (void) const |
void | addCompositeOffset (dReal x, dReal y, dReal z) |
dBodyID | getBody () const |
return the body; this function is created to make it possible to get the body from joint physics s More... | |
dMass | getODEMass (void) const |
returns the ode mass object More... | |
void | addMassToCompositeBody (dBodyID theBody, dMass *bodyMass) |
void | getAbsMass (dMass *pMass) const |
dReal | heightCallback (int x, int y) |
![]() | |
virtual | ~NodeInterface () |
Protected Member Functions | |
bool | createMesh (interfaces::NodeData *node) |
The method creates an ode mesh representation of the given node. More... | |
bool | createBox (interfaces::NodeData *node) |
The method creates an ode box representation of the given node. More... | |
bool | createSphere (interfaces::NodeData *node) |
The method creates an ode shpere representation of the given node. More... | |
bool | createCapsule (interfaces::NodeData *node) |
The method creates an ode capsule representation of the given node. More... | |
bool | createCylinder (interfaces::NodeData *node) |
The method creates an ode cylinder representation of the given node. More... | |
bool | createPlane (interfaces::NodeData *node) |
The method creates an ode plane. More... | |
bool | createHeightfield (interfaces::NodeData *node) |
void | setProperties (interfaces::NodeData *node) |
This method sets some properties for the node. More... | |
void | setInertiaMass (interfaces::NodeData *node) |
Protected Attributes | |
WorldPhysics * | theWorld |
dBodyID | nBody |
dGeomID | nGeom |
dMass | nMass |
dVector3 * | myVertices |
dTriIndex * | myIndices |
dTriMeshDataID | myTriMeshData |
bool | composite |
geom_data | node_data |
interfaces::terrainStruct * | terrain |
dReal * | height_data |
std::vector< sensor_list_element > | sensor_list |
The class that implements the NodeInterface interface.
Definition at line 91 of file NodePhysics.h.
mars::sim::NodePhysics::NodePhysics | ( | interfaces::PhysicsInterface * | world | ) |
Creates a empty node objekt.
Definition at line 70 of file NodePhysics.cpp.
|
virtual |
Destroys the node in the physical world.
pre:
post:
are the geom and the body realy all thing to take care of?
Definition at line 96 of file NodePhysics.cpp.
void mars::sim::NodePhysics::addCompositeOffset | ( | dReal | x, |
dReal | y, | ||
dReal | z | ||
) |
Definition at line 1293 of file NodePhysics.cpp.
|
virtual |
Adds a off-center force to a node.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 1184 of file NodePhysics.cpp.
|
virtual |
Adds a force to a node.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 1201 of file NodePhysics.cpp.
void mars::sim::NodePhysics::addMassToCompositeBody | ( | dBodyID | theBody, |
dMass * | bodyMass | ||
) |
Definition at line 1301 of file NodePhysics.cpp.
|
virtual |
This function adds a new sensor to the physical node.
Sensors that are implemented are a "ray sensor" and a "multi ray sensor"
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 1366 of file NodePhysics.cpp.
|
virtual |
Adds a torque to a node.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 1217 of file NodePhysics.cpp.
|
virtual |
This function rebuilds the geom (type, size and mass) of a node.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 992 of file NodePhysics.cpp.
|
protected |
The method creates an ode box representation of the given node.
Definition at line 660 of file NodePhysics.cpp.
|
protected |
The method creates an ode capsule representation of the given node.
Definition at line 724 of file NodePhysics.cpp.
|
protected |
The method creates an ode cylinder representation of the given node.
Definition at line 757 of file NodePhysics.cpp.
|
protected |
Definition at line 797 of file NodePhysics.cpp.
|
protected |
The method creates an ode mesh representation of the given node.
Definition at line 606 of file NodePhysics.cpp.
|
virtual |
The method creates an ode node, which properties are given by the NodeData param node.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 137 of file NodePhysics.cpp.
|
protected |
The method creates an ode plane.
Definition at line 790 of file NodePhysics.cpp.
|
protected |
The method creates an ode shpere representation of the given node.
Definition at line 695 of file NodePhysics.cpp.
|
virtual |
destroyes a node from the physics
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 1692 of file NodePhysics.cpp.
void mars::sim::NodePhysics::getAbsMass | ( | dMass * | pMass | ) | const |
Definition at line 1327 of file NodePhysics.cpp.
|
virtual |
The method copies the angular velocity of the physically node at the adress of the angular_vel pointer vel.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 420 of file NodePhysics.cpp.
dBodyID mars::sim::NodePhysics::getBody | ( | ) | const |
return the body; this function is created to make it possible to get the body from joint physics s
return the body; this function is created to make it possible to get the body from joint physics TO DO : test if the Node has a body
Definition at line 597 of file NodePhysics.cpp.
|
virtual |
Implements mars::interfaces::NodeInterface.
Definition at line 1748 of file NodePhysics.cpp.
|
virtual |
Implements mars::interfaces::NodeInterface.
Definition at line 1271 of file NodePhysics.cpp.
|
virtual |
Implements mars::interfaces::NodeInterface.
Definition at line 1241 of file NodePhysics.cpp.
|
virtual |
Implements mars::interfaces::NodeInterface.
Definition at line 1229 of file NodePhysics.cpp.
|
virtual |
The method copies the force of the physically node at the adress of the force pointer force.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 452 of file NodePhysics.cpp.
|
virtual |
Implements mars::interfaces::NodeInterface.
Definition at line 1222 of file NodePhysics.cpp.
|
virtual |
Implements mars::interfaces::NodeInterface.
Definition at line 1249 of file NodePhysics.cpp.
|
virtual |
The method copies the linear velocity of the physically node at the adress of the linear_vel pointer vel.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 388 of file NodePhysics.cpp.
|
virtual |
Implements mars::interfaces::NodeInterface.
Definition at line 1733 of file NodePhysics.cpp.
dMass mars::sim::NodePhysics::getODEMass | ( | void | ) | const |
|
virtual |
The method copies the position of the node at the adress of the pointer pos.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 226 of file NodePhysics.cpp.
|
virtual |
The method copies the Quaternion of the physically node at the adress of the Quaternion pointer q.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 354 of file NodePhysics.cpp.
|
virtual |
The method copies the torque of the physically node at the adress of the torque pointer force.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 484 of file NodePhysics.cpp.
|
virtual |
This function copies all sensor values to the specific allocated memory.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 1565 of file NodePhysics.cpp.
dReal mars::sim::NodePhysics::heightCallback | ( | int | x, |
int | y | ||
) |
Definition at line 1337 of file NodePhysics.cpp.
|
virtual |
Implements mars::interfaces::NodeInterface.
Definition at line 1544 of file NodePhysics.cpp.
|
virtual |
executes an rotation at a given point and returns the new position of the node
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 897 of file NodePhysics.cpp.
|
virtual |
Sets the angular velocity of a node.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 1139 of file NodePhysics.cpp.
|
virtual |
Implements mars::interfaces::NodeInterface.
Definition at line 1342 of file NodePhysics.cpp.
|
virtual |
Sets the force of a node.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 1154 of file NodePhysics.cpp.
|
protected |
Definition at line 1713 of file NodePhysics.cpp.
|
virtual |
Sets the linear velocity of a node.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 1124 of file NodePhysics.cpp.
|
virtual |
The method sets the position of the physical node model to the position of the param.
If move_group is set, all nodes of a composite group will be moved, otherwise only this node will be moved. A vector from the old position to the new will be returned.
I don't know if we should use this function in a way like it is implemented now. The pre and post conditions could loke like this:
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 272 of file NodePhysics.cpp.
|
protected |
This method sets some properties for the node.
The properties includes the posistion, the rotation, the movability and the coposite group number
Definition at line 836 of file NodePhysics.cpp.
|
virtual |
This method sets the rotation of the physically node.
I don't if and how to use this function yet. ^-^ If we need it, the pre and post conditions are like them in the set position method.
Implements mars::interfaces::NodeInterface.
Definition at line 509 of file NodePhysics.cpp.
|
virtual |
Sets the torque of a node.
pre:
post:
Implements mars::interfaces::NodeInterface.
Definition at line 1169 of file NodePhysics.cpp.
|
virtual |
This function sets the pointer to the physical world object.
I don't think that we need this function.
Implements mars::interfaces::NodeInterface.
Definition at line 587 of file NodePhysics.cpp.
|
protected |
Definition at line 145 of file NodePhysics.h.
|
protected |
Definition at line 148 of file NodePhysics.h.
|
protected |
Definition at line 143 of file NodePhysics.h.
|
protected |
Definition at line 144 of file NodePhysics.h.
|
protected |
Definition at line 142 of file NodePhysics.h.
|
protected |
Definition at line 139 of file NodePhysics.h.
|
protected |
Definition at line 140 of file NodePhysics.h.
|
protected |
Definition at line 141 of file NodePhysics.h.
|
protected |
Definition at line 146 of file NodePhysics.h.
|
protected |
Definition at line 149 of file NodePhysics.h.
|
protected |
Definition at line 147 of file NodePhysics.h.
|
protected |
Definition at line 138 of file NodePhysics.h.