39 #include "LinearMath/btQuickprof.h"
42 #include "tgGLDebugDrawer.h"
44 #include "BulletSoftBody/btSoftRigidDynamicsWorld.h"
56 BT_PROFILE(
"tgBulletRenderer::renderRod");
57 #endif //BT_NO_PROFILE
64 BT_PROFILE(
"tgBulletRenderer::renderString");
65 #endif //BT_NO_PROFILE
67 btDynamicsWorld& dynamicsWorld =
70 btIDebugDraw*
const pDrawer = dynamicsWorld.getDebugDrawer();
74 if(pDrawer && pSpringCable)
76 const std::vector<const tgSpringCableAnchor*>& anchors = pSpringCable->
getAnchors();
77 std::size_t n = anchors.size() - 1;
78 for (std::size_t i = 0; i < n; i++)
80 const btVector3 lineFrom =
81 anchors[i]->getWorldPosition();
82 const btVector3 lineTo =
83 anchors[i+1]->getWorldPosition();
85 const double stretch =
87 const btVector3 color =
89 btVector3(0.0, 0.0, 1.0) :
90 btVector3(0.5 + stretch / 3.0,
93 pDrawer->drawLine(lineFrom, lineTo, color);
100 #ifndef BT_NO_PROFILE
101 BT_PROFILE(
"tgBulletRenderer::renderModel");
102 #endif //BT_NO_PROFILE
109 btIDebugDraw*
const idraw = dynamicsWorld.getDebugDrawer();
110 for(
int j=0;j<model.getMarkers().size() ;j++)
Definitions of class tgSpringCable.
Contains the definition of class tgWorldBulletPhysicsImpl.
static btDynamicsWorld & worldToDynamicsWorld(const tgWorld &world)
virtual void render(const tgSpringCableActuator &mSCA) const
Utility class for class casting and filtering collections by type.
Markers for specific places on a tensegrity.
Contains the definition of abstract base class tgSpringCableActuator. Assumes that the string is line...
tgBulletRenderer(const tgWorld &world)
Contains the definition of class tgWorld $Id$.
Contains the definition of class tgBulletUtil.
virtual const std::vector< const tgSpringCableAnchor * > getAnchors() const =0
virtual const double getRestLength() const
Definitions of class tgSpringCableAnchor.
virtual const double getCurrentLength() const
Contains the definition of concrete class tgBulletRenderer.
btVector3 getWorldPosition() const
const tgSpringCable * getSpringCable() const