phycylinder.cpp
27 PhyCylinder::PhyCylinder( real radius, real height, World* w, QString name, const wMatrix& tm ) :
113 // The part of the cylinder not in segments of the list (which at the end will have the base color)
116 // Adding the first interval. We use a temporary list because the final one will have a different structure
121 for (QList<SegmentColor>::const_iterator it = segmentsColor.begin(); it != segmentsColor.end(); it++) {
131 // Now we fill m_segmentsColor so that it respects the format described in segmentsColor(). First we create
132 // a vector of SimpleIntervalAndColor, then sort it and finally use it to populate m_segmentsColor. This procedure
133 // works becayse tmpSegments is made up of intervals that cover the whole circle and without any overlapping
136 for (QList<SegmentColor>::const_iterator segmentIt = tmpSegments.constBegin(); segmentIt != tmpSegments.constEnd(); ++segmentIt) {
137 for (Intervals::const_iterator intervalIt = segmentIt->intervals.constBegin(); intervalIt != segmentIt->intervals.constEnd(); ++intervalIt) {
145 for (QList<SimpleIntervalAndColor>::const_iterator it = simpleIntervals.begin(); it != simpleIntervals.end(); ++it) {
160 // Our current color is not ours if we inherit color from parent! We need to get the color of our parent in that case
191 for (QMap<void*, bool>::iterator it = m_graphicalRepresentationNeedsUpdate.begin(); it != m_graphicalRepresentationNeedsUpdate.end(); ++it) {
199 wMatrix initialTransformationMatrix = wMatrix::identity(); // The transformation matrix is set in other places
212 NewtonBodySetForceAndTorqueCallback( priv->body, (PhyObjectPrivate::applyForceAndTorqueHandler) );
void setLowerBaseColor(QColor color)
Sets the color of the lower base.
Definition: phycylinder.cpp:64
bool graphicalRepresentationNeedsUpdate(void *renderer=NULL)
Whether the graphical representation should be updated or not.
Definition: phycylinder.cpp:158
void setUpperBaseColor(QColor color)
Sets the color of the upper base.
Definition: phycylinder.cpp:51
The structure used to define the color of intervals of the cylinder.
Definition: phycylinder.h:63
PhyCylinder(real radius, real height, World *world, QString name="unamed", const wMatrix &tm=wMatrix::identity())
Create a physics cylinder object and insert it in the world passed.
Definition: phycylinder.cpp:27
bool isEmpty() const
bool useColorTextureOfOwner() const
if true, we will use color and texture of our owner (if we have one)
Definition: wobject.cpp:93
float real
void setSegmentsColor(QColor base, const QList< SegmentColor > &segmentsColor)
Sets the color of segments of the cylinder.
Definition: phycylinder.cpp:104
QLinkedList< SimpleInterval >::const_iterator const_iterator
virtual void changedMatrix()
syncronize this object with underlying physic object
Definition: phyobject.cpp:145