![]() |
An open-source, flexible 3D physical simulation framework
|
Two typedefs to keep mesh structure nearly similar to ODE. More...
#include <SimNode.h>
Public Member Functions | |
SimNode (interfaces::ControlCenter *c, const interfaces::NodeData &sNode) | |
Set all important things. More... | |
~SimNode (void) | |
Clear a Node and its physically representation. More... | |
interfaces::sReal | getDensity (void) const |
Returns the density of the node. More... | |
interfaces::sReal | getMass (void) const |
Returns the mass of the node. More... | |
const interfaces::snmesh | getMesh (void) const |
Returns the mesh of the node. More... | |
const std::string | getName (void) const |
interfaces::NodeType | getPhysicMode (void) const |
const utils::Vector | getPosition (void) const |
const utils::Vector | getVisualPosition (void) const |
const utils::Quaternion | getRotation (void) const |
Returns the rotation of the node. More... | |
const utils::Quaternion | getVisualRotation (void) const |
const utils::Vector | getLinearVelocity (void) const |
const utils::Vector | getAngularVelocity (void) const |
const utils::Vector | getLinearAcceleration (void) const |
const utils::Vector | getAngularAcceleration (void) const |
const utils::Vector | getForce (void) const |
const utils::Vector | getTorque (void) const |
const std::string | getTexture (void) const |
Returns the name of the nodes texture. More... | |
const utils::Vector | getExtent (void) const |
returns the bounding extent of the node More... | |
bool | isMovable (void) const |
returns if node is a movable node More... | |
unsigned long | getGraphicsID2 (void) const |
int | getGroupID (void) const |
const interfaces::NodeData | getSNode (void) const |
Returns a pointer to the sNode. More... | |
interfaces::NodeInterface * | getInterface (void) const |
Gets the node interface object. More... | |
const interfaces::MaterialData | getMaterial (void) const |
unsigned long | getID (void) const |
Returns the node ID. More... | |
void | getCoreExchange (interfaces::core_objects_exchange *obj) const |
void | getPhysicalState (interfaces::nodeState *state) const |
bool | getGroundContact (void) const |
void | getMass (interfaces::sReal *mass, interfaces::sReal *inertia) const |
void | getContactPoints (std::vector< utils::Vector > *contact_points) const |
void | getContactIDs (std::list< interfaces::NodeId > *ids) const |
int | getVisualRep (void) const |
void | getDataBrokerNames (std::string *groupName, std::string *dataName) const |
double | getCollisionDepth (void) const |
const interfaces::contact_params | getContactParams () const |
const utils::Vector | getContactForce (void) const |
interfaces::sReal | getGroundContactForce (void) const |
void | setDensity (interfaces::sReal objectdensity) |
Sets the density of the node. More... | |
void | setExtent (const utils::Vector &ext, bool update=false) |
sets the extend of the node More... | |
void | setMass (interfaces::sReal objectmass) |
Sets the mass of the node. More... | |
void | setMesh (const interfaces::snmesh &objectmesh) |
Sets the mesh of the node. More... | |
void | setName (const std::string &objectname) |
Sets the name of the node. More... | |
void | setGraphicsID (unsigned long g_id) |
unsigned long | getGraphicsID (void) const |
void | setGraphicsID2 (unsigned long g_id) |
void | setPhysicMode (interfaces::NodeType mode) |
Sets the physic mode of the node. See getPhysicMode for list of modes. More... | |
const utils::Vector | setPosition (const utils::Vector &newPosition, bool move_group) |
Sets the position of the node. More... | |
void | setPositionOffset (const utils::Vector &offset) |
const utils::Quaternion | setRotation (const utils::Quaternion &rotation, bool move_all) |
Sets the rotation of the node. More... | |
void | setMovable (bool movable) |
Set the node movable/non-movable. More... | |
void | setColor (utils::Vector v) |
void | setTexture (const std::string &tname) |
Sets the node's texture name. More... | |
void | setMaterial (const interfaces::MaterialData &material) |
void | setPhysicalState (const interfaces::nodeState &state) |
void | setFromSNode (const interfaces::NodeData &sNode) |
void | setInterface (interfaces::NodeInterface *_interface) |
Sets the node interface object. More... | |
void | setRelativePosition (const interfaces::NodeData &node) |
void | setContactParams (const interfaces::contact_params &cp) |
void | setLinearVelocity (const utils::Vector &vel) |
void | setAngularVelocity (const utils::Vector &vel) |
void | setAngularDamping (interfaces::sReal damping) |
void | setVisualRep (int val) |
void | setContactMotion1 (interfaces::sReal motion) |
void | setMaterialName (const std::string &name) |
void | setRelativeID (interfaces::NodeId id) |
void | setVisQOffset (utils::Quaternion q) |
void | update (interfaces::sReal calc_ms, bool physics_thread=true) |
Updates the values of the node from the physical layer. More... | |
void | rotateAtPoint (const utils::Vector &rotation_point, const utils::Quaternion &rotation, bool move_group) |
void | changeNode (interfaces::NodeData *node) |
void | clearRelativePosition (void) |
void | applyForce (const utils::Vector &force, const utils::Vector &pos) |
void | applyForce (const utils::Vector &force) |
void | applyTorque (const utils::Vector &torque) |
void | addSensor (interfaces::BaseSensor *sensor) |
void | reloadSensor (interfaces::BaseSensor *s_cfg) |
void | removeSensor (interfaces::BaseSensor &s_cfg) |
void | addRotation (const utils::Quaternion &q) |
void | checkNodeState (void) |
void | updateRay (void) |
virtual void | produceData (const data_broker::DataInfo &info, data_broker::DataPackage *package, int callbackParam) |
void | updatePR (const utils::Vector &pos, const utils::Quaternion &rot, const utils::Vector &visOffsetPos, const utils::Quaternion &visOffsetRot) |
interfaces::NodeId | getParentID () |
void | setCullMask (int mask) |
void | setBrightness (double v) |
![]() | |
ProducerInterface () | |
virtual | ~ProducerInterface () |
Private Member Functions | |
void | addToDataBroker () |
void | removeFromDataBroker () |
Two typedefs to keep mesh structure nearly similar to ODE.
original ODE structure is not being used here to keep the possibility to change physic engine
Each SimNode object publishes its state on the dataBroker. The name under which the data is published can be obtained from the nodeId via NodeManager::getDataBrokerNames. The data_broker::DataPackage will contain the following items:
mars::sim::SimNode::SimNode | ( | interfaces::ControlCenter * | c, |
const interfaces::NodeData & | sNode | ||
) |
Set all important things.
important initial values:
Definition at line 60 of file SimNode.cpp.
mars::sim::SimNode::~SimNode | ( | void | ) |
Clear a Node and its physically representation.
If the node has a physically representation, it has to be cleared as well.
Definition at line 130 of file SimNode.cpp.
void mars::sim::SimNode::addRotation | ( | const utils::Quaternion & | q | ) |
Definition at line 773 of file SimNode.cpp.
void mars::sim::SimNode::addSensor | ( | interfaces::BaseSensor * | sensor | ) |
Definition at line 739 of file SimNode.cpp.
|
private |
Definition at line 853 of file SimNode.cpp.
void mars::sim::SimNode::applyForce | ( | const utils::Vector & | force, |
const utils::Vector & | pos | ||
) |
Definition at line 719 of file SimNode.cpp.
void mars::sim::SimNode::applyForce | ( | const utils::Vector & | force | ) |
Definition at line 723 of file SimNode.cpp.
void mars::sim::SimNode::applyTorque | ( | const utils::Vector & | torque | ) |
Definition at line 728 of file SimNode.cpp.
void mars::sim::SimNode::changeNode | ( | interfaces::NodeData * | node | ) |
Definition at line 649 of file SimNode.cpp.
void mars::sim::SimNode::checkNodeState | ( | void | ) |
Definition at line 778 of file SimNode.cpp.
void mars::sim::SimNode::clearRelativePosition | ( | void | ) |
Definition at line 708 of file SimNode.cpp.
const Vector mars::sim::SimNode::getAngularAcceleration | ( | void | ) | const |
Definition at line 305 of file SimNode.cpp.
const Vector mars::sim::SimNode::getAngularVelocity | ( | void | ) | const |
Definition at line 297 of file SimNode.cpp.
double mars::sim::SimNode::getCollisionDepth | ( | void | ) | const |
Definition at line 822 of file SimNode.cpp.
const Vector mars::sim::SimNode::getContactForce | ( | void | ) | const |
Definition at line 809 of file SimNode.cpp.
void mars::sim::SimNode::getContactIDs | ( | std::list< interfaces::NodeId > * | ids | ) | const |
Definition at line 802 of file SimNode.cpp.
const contact_params mars::sim::SimNode::getContactParams | ( | ) | const |
Definition at line 752 of file SimNode.cpp.
void mars::sim::SimNode::getContactPoints | ( | std::vector< utils::Vector > * | contact_points | ) | const |
Definition at line 795 of file SimNode.cpp.
void mars::sim::SimNode::getCoreExchange | ( | interfaces::core_objects_exchange * | obj | ) | const |
Definition at line 602 of file SimNode.cpp.
void mars::sim::SimNode::getDataBrokerNames | ( | std::string * | groupName, |
std::string * | dataName | ||
) | const |
Definition at line 831 of file SimNode.cpp.
double mars::sim::SimNode::getDensity | ( | void | ) | const |
Returns the density of the node.
Definition at line 338 of file SimNode.cpp.
const Vector mars::sim::SimNode::getExtent | ( | void | ) | const |
returns the bounding extent of the node
Definition at line 425 of file SimNode.cpp.
const Vector mars::sim::SimNode::getForce | ( | void | ) | const |
Definition at line 309 of file SimNode.cpp.
unsigned long mars::sim::SimNode::getGraphicsID | ( | void | ) | const |
Definition at line 180 of file SimNode.cpp.
unsigned long mars::sim::SimNode::getGraphicsID2 | ( | void | ) | const |
Definition at line 190 of file SimNode.cpp.
bool mars::sim::SimNode::getGroundContact | ( | void | ) | const |
Definition at line 698 of file SimNode.cpp.
sReal mars::sim::SimNode::getGroundContactForce | ( | void | ) | const |
Definition at line 703 of file SimNode.cpp.
int mars::sim::SimNode::getGroupID | ( | void | ) | const |
Definition at line 318 of file SimNode.cpp.
unsigned long mars::sim::SimNode::getID | ( | void | ) | const |
Returns the node ID.
Definition at line 440 of file SimNode.cpp.
NodeInterface * mars::sim::SimNode::getInterface | ( | void | ) | const |
Gets the node interface object.
Definition at line 435 of file SimNode.cpp.
const Vector mars::sim::SimNode::getLinearAcceleration | ( | void | ) | const |
Definition at line 301 of file SimNode.cpp.
const Vector mars::sim::SimNode::getLinearVelocity | ( | void | ) | const |
Definition at line 293 of file SimNode.cpp.
double mars::sim::SimNode::getMass | ( | void | ) | const |
Returns the mass of the node.
Definition at line 328 of file SimNode.cpp.
void mars::sim::SimNode::getMass | ( | interfaces::sReal * | mass, |
interfaces::sReal * | inertia | ||
) | const |
Definition at line 763 of file SimNode.cpp.
const MaterialData mars::sim::SimNode::getMaterial | ( | void | ) | const |
Definition at line 383 of file SimNode.cpp.
const snmesh mars::sim::SimNode::getMesh | ( | void | ) | const |
Returns the mesh of the node.
Definition at line 348 of file SimNode.cpp.
const std::string mars::sim::SimNode::getName | ( | void | ) | const |
Definition at line 170 of file SimNode.cpp.
|
inline |
void mars::sim::SimNode::getPhysicalState | ( | interfaces::nodeState * | state | ) | const |
Definition at line 674 of file SimNode.cpp.
NodeType mars::sim::SimNode::getPhysicMode | ( | void | ) | const |
Definition at line 358 of file SimNode.cpp.
const Vector mars::sim::SimNode::getPosition | ( | void | ) | const |
Definition at line 227 of file SimNode.cpp.
const Quaternion mars::sim::SimNode::getRotation | ( | void | ) | const |
Returns the rotation of the node.
rotation
of the node Definition at line 271 of file SimNode.cpp.
const NodeData mars::sim::SimNode::getSNode | ( | void | ) | const |
Returns a pointer to the sNode.
returns a pointer to the sNode
Definition at line 491 of file SimNode.cpp.
const std::string mars::sim::SimNode::getTexture | ( | void | ) | const |
Returns the name of the nodes texture.
Definition at line 391 of file SimNode.cpp.
const Vector mars::sim::SimNode::getTorque | ( | void | ) | const |
Definition at line 313 of file SimNode.cpp.
const Vector mars::sim::SimNode::getVisualPosition | ( | void | ) | const |
Definition at line 232 of file SimNode.cpp.
int mars::sim::SimNode::getVisualRep | ( | void | ) | const |
Definition at line 243 of file SimNode.cpp.
const Quaternion mars::sim::SimNode::getVisualRotation | ( | void | ) | const |
Definition at line 276 of file SimNode.cpp.
bool mars::sim::SimNode::isMovable | ( | void | ) | const |
returns if node is a movable node
Definition at line 368 of file SimNode.cpp.
|
virtual |
Implements mars::data_broker::ProducerInterface.
Definition at line 158 of file SimNode.cpp.
void mars::sim::SimNode::reloadSensor | ( | interfaces::BaseSensor * | s_cfg | ) |
Definition at line 744 of file SimNode.cpp.
|
private |
Definition at line 868 of file SimNode.cpp.
void mars::sim::SimNode::removeSensor | ( | interfaces::BaseSensor & | s_cfg | ) |
void mars::sim::SimNode::rotateAtPoint | ( | const utils::Vector & | rotation_point, |
const utils::Quaternion & | rotation, | ||
bool | move_group | ||
) |
Definition at line 619 of file SimNode.cpp.
void mars::sim::SimNode::setAngularDamping | ( | interfaces::sReal | damping | ) |
Definition at line 768 of file SimNode.cpp.
void mars::sim::SimNode::setAngularVelocity | ( | const utils::Vector & | vel | ) |
Definition at line 690 of file SimNode.cpp.
void mars::sim::SimNode::setBrightness | ( | double | v | ) |
Definition at line 847 of file SimNode.cpp.
void mars::sim::SimNode::setColor | ( | utils::Vector | v | ) |
Definition at line 497 of file SimNode.cpp.
void mars::sim::SimNode::setContactMotion1 | ( | interfaces::sReal | motion | ) |
Definition at line 733 of file SimNode.cpp.
void mars::sim::SimNode::setContactParams | ( | const interfaces::contact_params & | cp | ) |
Definition at line 757 of file SimNode.cpp.
void mars::sim::SimNode::setCullMask | ( | int | mask | ) |
Definition at line 841 of file SimNode.cpp.
void mars::sim::SimNode::setDensity | ( | interfaces::sReal | objectdensity | ) |
Sets the density of the node.
Definition at line 333 of file SimNode.cpp.
void mars::sim::SimNode::setExtent | ( | const utils::Vector & | ext, |
bool | update = false |
||
) |
sets the extend of the node
Definition at line 396 of file SimNode.cpp.
void mars::sim::SimNode::setFromSNode | ( | const interfaces::NodeData & | sNode | ) |
Definition at line 446 of file SimNode.cpp.
void mars::sim::SimNode::setGraphicsID | ( | unsigned long | g_id | ) |
Definition at line 175 of file SimNode.cpp.
void mars::sim::SimNode::setGraphicsID2 | ( | unsigned long | g_id | ) |
Definition at line 185 of file SimNode.cpp.
void mars::sim::SimNode::setInterface | ( | interfaces::NodeInterface * | _interface | ) |
Sets the node interface object.
Definition at line 430 of file SimNode.cpp.
void mars::sim::SimNode::setLinearVelocity | ( | const utils::Vector & | vel | ) |
Definition at line 682 of file SimNode.cpp.
void mars::sim::SimNode::setMass | ( | interfaces::sReal | objectmass | ) |
Sets the mass of the node.
Definition at line 323 of file SimNode.cpp.
void mars::sim::SimNode::setMaterial | ( | const interfaces::MaterialData & | material | ) |
Definition at line 378 of file SimNode.cpp.
|
inline |
void mars::sim::SimNode::setMesh | ( | const interfaces::snmesh & | objectmesh | ) |
Sets the mesh of the node.
Definition at line 343 of file SimNode.cpp.
void mars::sim::SimNode::setMovable | ( | bool | movable | ) |
Set the node movable/non-movable.
Definition at line 363 of file SimNode.cpp.
void mars::sim::SimNode::setName | ( | const std::string & | objectname | ) |
Sets the name of the node.
Definition at line 165 of file SimNode.cpp.
void mars::sim::SimNode::setPhysicalState | ( | const interfaces::nodeState & | state | ) |
Definition at line 664 of file SimNode.cpp.
void mars::sim::SimNode::setPhysicMode | ( | interfaces::NodeType | mode | ) |
Sets the physic mode of the node. See getPhysicMode for list of modes.
Definition at line 353 of file SimNode.cpp.
const Vector mars::sim::SimNode::setPosition | ( | const utils::Vector & | newPosition, |
bool | move_group | ||
) |
Sets the position of the node.
Definition at line 195 of file SimNode.cpp.
void mars::sim::SimNode::setPositionOffset | ( | const utils::Vector & | offset | ) |
Definition at line 222 of file SimNode.cpp.
|
inline |
void mars::sim::SimNode::setRelativePosition | ( | const interfaces::NodeData & | node | ) |
Definition at line 713 of file SimNode.cpp.
const Quaternion mars::sim::SimNode::setRotation | ( | const utils::Quaternion & | rotation, |
bool | move_all | ||
) |
Sets the rotation of the node.
Definition at line 249 of file SimNode.cpp.
void mars::sim::SimNode::setTexture | ( | const std::string & | tname | ) |
Sets the node's texture name.
Definition at line 373 of file SimNode.cpp.
|
inline |
void mars::sim::SimNode::setVisualRep | ( | int | val | ) |
Definition at line 238 of file SimNode.cpp.
void mars::sim::SimNode::update | ( | interfaces::sReal | calc_ms, |
bool | physics_thread = true |
||
) |
Updates the values of the node from the physical layer.
pre:
Definition at line 521 of file SimNode.cpp.
void mars::sim::SimNode::updatePR | ( | const utils::Vector & | pos, |
const utils::Quaternion & | rot, | ||
const utils::Vector & | visOffsetPos, | ||
const utils::Quaternion & | visOffsetRot | ||
) |
Definition at line 281 of file SimNode.cpp.
void mars::sim::SimNode::updateRay | ( | void | ) |
Definition at line 817 of file SimNode.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |