20 #include "phycylinder.h"
21 #include "private/phyobjectprivate.h"
22 #include "private/worldprivate.h"
23 #include <QtAlgorithms>
34 m_graphicalRepresentationNeedsUpdate(true),
37 w->pushObject(
this );
43 #ifdef WORLDSIM_USE_NEWTON
50 m_upperBaseColor =
color;
58 m_graphicalRepresentationNeedsUpdate =
true;
63 m_lowerBaseColor =
color;
71 m_graphicalRepresentationNeedsUpdate =
true;
77 qSort(m_segmentsColor.begin(), m_segmentsColor.end());
85 m_graphicalRepresentationNeedsUpdate =
true;
90 const bool ret = (m_graphicalRepresentationNeedsUpdate || (m_oldColorv !=
colorv));
92 m_graphicalRepresentationNeedsUpdate =
false;
99 #ifdef WORLDSIM_USE_NEWTON
100 NewtonCollision* c = NewtonCreateCylinder( worldpriv->world, radiusv, heightv, 1, 0 );
102 priv->body = NewtonCreateBody( worldpriv->world, c, &initialTransformationMatrix[0][0] );
104 NewtonBodySetAutoSleep(
priv->body, 0 );
106 NewtonBodySetUserData(
priv->body,
this );
107 NewtonBodySetLinearDamping(
priv->body, 0.0 );
109 NewtonBodySetAngularDamping(
priv->body, &zero[0] );
110 NewtonBodySetAutoSleep(
priv->body, 0 );
111 NewtonBodySetFreezeState(
priv->body, 0 );
113 NewtonBodySetTransformCallback(
priv->body, (PhyObjectPrivate::setTransformHandler) );
114 NewtonBodySetForceAndTorqueCallback(
priv->body, (PhyObjectPrivate::applyForceAndTorqueHandler) );