dart
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
TinkertoyWorldNode Class Reference
Inheritance diagram for TinkertoyWorldNode:
Inheritance graph
[legend]
Collaboration diagram for TinkertoyWorldNode:
Collaboration graph
[legend]

Public Member Functions

 TinkertoyWorldNode (const dart::simulation::WorldPtr &world)
 
void setAllBodyColors (const Eigen::Vector4d &color)
 
void setPickedNodeColor (const Eigen::Vector4d &color)
 
void resetForceLine ()
 
void customPreRefresh () override
 If update() is not overloaded, this function will be called at the beginning of each rendering cycle. More...
 
void customPreStep () override
 If update() is not overloaded, this function will be called at the beginning of each simulation step. More...
 
void handlePick (const dart::gui::osg::PickInfo &pick)
 
void clearPick ()
 
void deletePick ()
 
void createShapes ()
 
void createWeldJointShape ()
 
void createRevoluteJointShape ()
 
void createBallJointShape ()
 
void createBlockShape ()
 
template<class JointType >
std::pair< JointType *, dart::dynamics::BodyNode * > addBlock (dart::dynamics::BodyNode *parent, const Eigen::Isometry3d &relTf, const dart::dynamics::ShapePtr &jointShape)
 
Eigen::Isometry3d getRelTf () const
 
void addWeldJointBlock ()
 
dart::dynamics::BodyNodeaddWeldJointBlock (dart::dynamics::BodyNode *parent, const Eigen::Isometry3d &relTf)
 
void addRevoluteJointBlock ()
 
dart::dynamics::BodyNodeaddRevoluteJointBlock (dart::dynamics::BodyNode *parent, const Eigen::Isometry3d &relTf)
 
void addBallJointBlock ()
 
dart::dynamics::BodyNodeaddBallJointBlock (dart::dynamics::BodyNode *parent, const Eigen::Isometry3d &relTf)
 
void createInitialToy1 ()
 
void createInitialToy2 ()
 
void createForceLine ()
 
void setForceCoeff (double coeff)
 
double getForceCoeff () const
 
void incrementForceCoeff ()
 
void decrementForceCoeff ()
 
void reorientTarget ()
 
- Public Member Functions inherited from dart::gui::osg::RealTimeWorldNode
 RealTimeWorldNode (const std::shared_ptr< dart::simulation::World > &world=nullptr, const ::osg::ref_ptr< osgShadow::ShadowTechnique > &shadower=nullptr, double targetFrequency=60.0, double targetRealTimeFactor=1.0)
 Construct a world node that will attempt to run a simulation with close to real-time playback. More...
 
void setTargetFrequency (double targetFrequency)
 Set the target refresh rate frequency.
 
double getTargetFrequency () const
 Get the target refresh rate frequency.
 
void setTargetRealTimeFactor (double targetRTF)
 Set the target real time factor.
 
double getTargetRealTimeFactor () const
 Get the target real time factor.
 
double getLastRealTimeFactor () const
 Get the real time factor that was achieved in the last refresh cycle. More...
 
double getLowestRealTimeFactor () const
 Get the lowest real time factor that has been hit during the simulation.
 
double getHighestRealTimeFactor () const
 Get the highest real time factor that has been hit during the simulation.
 
void refresh () override
 This function is called at the beginning of each rendering cycle. More...
 
- Public Member Functions inherited from dart::gui::osg::WorldNode
 WorldNode (std::shared_ptr< dart::simulation::World > world=nullptr, ::osg::ref_ptr< osgShadow::ShadowTechnique > shadowTechnique=nullptr)
 Default constructor Shadows are disabled by default.
 
void setWorld (std::shared_ptr< dart::simulation::World > newWorld)
 Set the World that this WorldNode is associated with.
 
std::shared_ptr< dart::simulation::WorldgetWorld () const
 Get the World that this WorldNode is associated with.
 
virtual void customPostRefresh ()
 If update() is not overloaded, this function will be called at the end of each rendering cycle. More...
 
virtual void customPostStep ()
 If update() is not overloaded, this function will be called at the end of each simulation step. More...
 
bool isSimulating () const
 Returns true iff the WorldNode is stepping between render cycles.
 
void simulate (bool on)
 Pass in true to take steps between render cycles; pass in false to turn off steps between render cycles. More...
 
void setNumStepsPerCycle (std::size_t steps)
 Set the number of steps to take between each render cycle (only if the simulation is not paused)
 
std::size_t getNumStepsPerCycle () const
 Get the number of steps that will be taken between each render cycle (only if the simulation is not paused)
 
bool isShadowed () const
 Get whether the WorldNode is casting shadows.
 
void setShadowTechnique (::osg::ref_ptr< osgShadow::ShadowTechnique > shadowTechnique=nullptr)
 Set the ShadowTechnique If you wish to disable shadows, pass a nullptr.
 
::osg::ref_ptr< osgShadow::ShadowTechnique > getShadowTechnique () const
 Get the current ShadowTechnique nullptr is there are no shadows.
 
static ::osg::ref_ptr< osgShadow::ShadowTechnique > createDefaultShadowTechnique (const Viewer *viewer)
 Helper function to create a default ShadowTechnique given a Viewer the default ShadowTechnique is ShadowMap.
 
virtual ~WorldNode ()
 Destructor.
 

Public Attributes

float mForceCoeff
 

Protected Member Functions

void setupViewer () override
 Called when this world gets added to an dart::gui::osg::Viewer. More...
 
- Protected Member Functions inherited from dart::gui::osg::WorldNode
void clearChildUtilizationFlags ()
 Clear the utilization flags of each child node.
 
void clearUnusedNodes ()
 Clear any nodes whose utilization flags were not triggered on this render cycle.
 
void refreshSkeletons ()
 Refresh all the Skeleton rendering data.
 
void refreshSimpleFrames ()
 Refresh all the custom Frame rendering data.
 
void refreshBaseFrameNode (dart::dynamics::Frame *frame)
 
void refreshShapeFrameNode (dart::dynamics::Frame *frame)
 

Protected Attributes

dart::dynamics::ShapePtr mWeldJointShape
 
dart::dynamics::ShapePtr mRevoluteJointShape
 
dart::dynamics::ShapePtr mBallJointShape
 
dart::dynamics::ShapePtr mBlockShape
 
Eigen::Isometry3d mBlockOffset
 
dart::dynamics::BodyNodemPickedNode
 
Eigen::Vector3d mPickedPoint
 
dart::gui::osg::InteractiveFramePtr mTarget
 
dart::dynamics::LineSegmentShapePtr mForceLine
 
bool mWasSimulating
 
- Protected Attributes inherited from dart::gui::osg::RealTimeWorldNode
bool mFirstRefresh
 Reset each time the simulation is paused.
 
::osg::Timer mRefreshTimer
 Keeps track of the time between refreshes.
 
double mTargetRealTimeLapse
 The target for how much time should elapse between refreshes.
 
double mTargetSimTimeLapse
 The target for how much simulation time should elapse between refreshes.
 
double mLastRealTimeFactor
 The RTF that was achieved in the last refresh cycle.
 
double mLowestRealTimeFactor
 The lowest RTF that has been achieved.
 
double mHighestRealTimeFactor
 The highest RTF that has been achieved.
 
- Protected Attributes inherited from dart::gui::osg::WorldNode
NodeMap mFrameToNode
 Map from Frame pointers to FrameNode pointers.
 
std::shared_ptr< dart::simulation::WorldmWorld
 The World that this WorldNode is associated with.
 
bool mSimulating
 True iff simulation is active.
 
std::size_t mNumStepsPerCycle
 Number of steps to take between rendering cycles.
 
ViewermViewer
 Viewer that this WorldNode is inside of.
 
::osg::ref_ptr<::osg::Group > mNormalGroup
 OSG group for non-shadowed objects.
 
::osg::ref_ptr<::osgShadow::ShadowedScene > mShadowedGroup
 OSG group for shadowed objects.
 
bool mShadowed
 Whether the shadows are enabled.
 

Additional Inherited Members

- Protected Types inherited from dart::gui::osg::WorldNode
using NodeMap = std::unordered_map< dart::dynamics::Frame *, ::osg::ref_ptr< ShapeFrameNode > >
 

Member Function Documentation

◆ customPreRefresh()

void TinkertoyWorldNode::customPreRefresh ( )
inlineoverridevirtual

If update() is not overloaded, this function will be called at the beginning of each rendering cycle.

This function can be overloaded to customize the behavior of each update. The default behavior is to do nothing, so overloading this function will not interfere with the usual update() operation.

Reimplemented from dart::gui::osg::WorldNode.

◆ customPreStep()

void TinkertoyWorldNode::customPreStep ( )
inlineoverridevirtual

If update() is not overloaded, this function will be called at the beginning of each simulation step.

This function can be overloaded to customize the behavior of each step. The default behavior is to do nothing, so overloading this function will not interfere with the usual update() operation. This will not get called if the simulation is paused.

Reimplemented from dart::gui::osg::WorldNode.

◆ setupViewer()

void TinkertoyWorldNode::setupViewer ( )
inlineoverrideprotectedvirtual

Called when this world gets added to an dart::gui::osg::Viewer.

Override this function to customize the way your WorldNode starts up in an dart::gui::osg::Viewer. Default behavior does nothing.

Reimplemented from dart::gui::osg::WorldNode.


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