GL Studio C++ Runtime API
gls_3d_cable.h
Go to the documentation of this file.
1/*! \file
2 \brief The disti::Gls3DCable class.
3
4 \par Copyright Information
5
6 Copyright (c) 2017 by The DiSTI Corporation.<br>
7 11301 Corporate Blvd; Suite 100<br>
8 Orlando, Florida 32817<br>
9 USA<br>
10 <br>
11 All rights reserved.<br>
12
13 This Software contains proprietary trade secrets of DiSTI and may not be
14reproduced, in whole or part, in any form, or by any means of electronic,
15mechanical, or otherwise, without the written permission of DiSTI. Said
16permission may be derived through the purchase of applicable DiSTI product
17licenses which detail the distribution rights of this content and any
18Derivative Works based on this or other copyrighted DiSTI Software.
19
20 NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26
27 LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34EXCEED FIVE DOLLARS (US$5.00).
35
36 The aforementioned terms and restrictions are governed by the laws of the
37State of Florida and the United States of America.
38*/
39
40#ifndef _GLS3DCABLE_H
41#define _GLS3DCABLE_H
42
43#include <vector>
44
45#include "glpolygon.h"
47#include "gls_quaternion.h"
48#include "gltrimesh.h"
49#include "group.h"
50
51/// Provides support for creating DLLs.
52#if( defined( GLSGEN_EXPORT_GLS3DCABLE ) || defined( GLSGEN_IMPORT_GLS3DCABLE ) || defined( GLS_EXPORT_GENERATED ) || defined( GLS_IMPORT_GENERATED ) ) \
53 && defined( _MSC_VER )
54# if defined( GLSGEN_EXPORT_GLS3DCABLE ) || defined( GLS_EXPORT_GENERATED )
55# define GLSGEN_GLS3DCABLE_EXPORT __declspec( dllexport )
56# else
57# define GLSGEN_GLS3DCABLE_EXPORT __declspec( dllimport )
58# endif
59#else
60# define GLSGEN_GLS3DCABLE_EXPORT
61#endif
62///////////////////////////////////////////////////////////////////////////////
63
64/// Automatically link the runtime library plugin (on Windows).
65#define LIB_BASE_NAME "gls_3d_cable"
66#include "gls_auto_lib.h"
67#undef LIB_BASE_NAME
68
69namespace disti
70{
71// SetValue enumerations
72enum
73{
74 GLS_3DCABLE_FIRST_VALUE = GLS_LAST_INITIALIZER + 1,
75
76 GLS_3DCABLE_FLEXIBILITY,
77 GLS_3DCABLE_NUMBEROFSEGMENTS,
78 GLS_3DCABLE_NUMBEROFSIDES,
79 GLS_3DCABLE_RADIUS,
80 GLS_3DCABLE_LENGTH,
81 GLS_3DCABLE_GRAVITY,
82 GLS_3DCABLE_SECTIONSLACKPCT,
83 GLS_3DCABLE_SECTIONFLOORDIST,
84 GLS_3DCABLE_COLLISIONSTYLE,
85 GLS_3DCABLE_FILLCOLOR,
86 GLS_3DCABLE_LINECOLOR
87};
88
89typedef DynamicArray<double> DynamicDoubleArray; ///< Typedef for dynamic array of slack percentages.
90
91/// \details The PreciseVertex class. Uses fuzzy floating point comparison rather than exact matches.
93{
94public:
97 {}
98
99 /// Constructor from Vector
100 /// \param vector The vector to construct from.
101 PreciseVertex( const Vector& vector )
102 : VertexNoColor( vector.x, vector.y, vector.z )
103 {}
104
105 /// Constructor from three floats
106 /// \param x The x component to construct from.
107 /// \param y The y component to construct from.
108 /// \param z The z component to construct from.
109 PreciseVertex( float x, float y, float z )
110 : VertexNoColor( x, y, z )
111 {}
112
113 /**
114 If the values are near zero, force them to be Zero!
115 \pre
116 \post
117 */
118 void NearZero()
119 {
120 const float DIFF = 0.0001f;
121
122 if( BETWEEN( x, 0.0 - DIFF, 0.0 + DIFF ) )
123 {
124 x = 0.0f;
125 }
126
127 if( BETWEEN( y, 0.0 - DIFF, 0.0 + DIFF ) )
128 {
129 y = 0.0f;
130 }
131
132 if( BETWEEN( z, 0.0 - DIFF, 0.0 + DIFF ) )
133 {
134 z = 0.0f;
135 }
136 }
137
138 /** Normalizes the vector into a unit vector */
140 {
141 double length = Magnitude();
142
143 // how close to zero do we want to be?
144 const double DIFF = 0.0001;
145
146 if( !BETWEEN( length, 0.0 - DIFF, 0.0 + DIFF ) )
147 {
148 // Divide is slow so calculate 1/length and multiply to save time
149 double inv_length = 1.0 / length;
150
151 x = float( x * inv_length );
152 y = float( y * inv_length );
153 z = float( z * inv_length );
154 }
155 else
156 {
157 x = 0.0f;
158 y = 0.0f;
159 z = 0.0f;
160 }
161 }
162
163 /** Determines if the vertex is identical to the supplied vertex, ignoring color
164 \param arg vertex to compare to
165 \return TRUE if equal, else FALSE
166 */
167 bool operator==( const VertexNoColor& arg ) const
168 {
169 const double DIFF = 0.0001;
170 return ( BETWEEN( x, arg.x - DIFF, arg.x + DIFF ) && BETWEEN( y, arg.y - DIFF, arg.y + DIFF ) && BETWEEN( z, arg.z - DIFF, arg.z + DIFF ) );
171 }
172
173 /** Determines if the vertex is identical to the supplied vertex, ignoring color
174 \param arg vertex to compare to
175 \return TRUE if equal, else FALSE
176 */
177 bool operator!=( const VertexNoColor& arg ) const
178 {
179 const double DIFF = 0.0001;
180 return ( !BETWEEN( x, arg.x - DIFF, arg.x + DIFF ) || !BETWEEN( y, arg.y - DIFF, arg.y + DIFF ) || !BETWEEN( z, arg.z - DIFF, arg.z + DIFF ) );
181 }
182};
183
184/**
185 Runtime implementation of a Gls3DCable. The Gls3DCable is a cable mesh between
186 two or more endpoint objects. The user controls the length, the flexibility, the
187 diameter, the smoothness (segments and sides), and the droop of the cable.
188*/
189class Gls3DCable : public Group
190{
191public:
192 DISTI_DEPRECATED( "This identifier is forbidden by the C++ standard. Use BaseClass instead." )
193 typedef Group _BaseClass; ///< Deprecated typedef for the base class.
194 typedef Group BaseClass; ///< Typedef for the base class.
195
196 enum
197 {
198 TEXTUREPOINT_MULT = 50
199 };
200
201 /** Sides limits */
202 enum
203 {
204 MIN_NUMBER_OF_SIDES = 1,
205 MAX_NUMBER_OF_SIDES = 100 // visually 50 looked good, 100 gives the user room
206 };
207
208 /** Segement limits */
209 enum
210 {
211 MIN_SEGEMENTS = 1,
212 MAX_SEGEMENTS = 10000 // Seems like 10,000 segements should be way big enough
213 };
214
215 /// Collision model
217 {
218 COLLISIONSTYLE_NONE = 0,
219 COLLISIONSTYLE_FAST
220#if defined( USE_COLLISIONSTYLE_SLOW )
221 ,
222 COLLISIONSTYLE_SLOW
223#endif
224 };
225
226 friend class Gls3DCableEditor;
227
228 /// Create a new Gls3DCable.
229 /// \param generateInstance Whether or not to generate an instance name for this object.
230 GLSGEN_GLS3DCABLE_EXPORT Gls3DCable( bool generateInstance = false );
231
232 /// Copy constructor for Gls3DCable
233 /// \param that The Gls3DCable to be copied from.
234 /// \param generateNames Whether or not to generate a new instance name.
235 GLSGEN_GLS3DCABLE_EXPORT Gls3DCable( const Gls3DCable& that, const bool generateNames );
236
237 /** Destructs a Gls3DCable object */
239
240 /// \return A pointer to a new Gls3DCable.
242
243 //////////////////////////////////////////////////
244 // Overridden base class methods
245 // The base class methods are overridden so that the Group Class methods
246 // are not called, generally DisplayObject methods are called, there
247 // are a few exceptions.
248 //////////////////////////////////////////////////
249
250 /// \copydoc DisplayObject::GetResources
251 virtual void GetResources( std::ostream& outstr, GlsResourceFilter* filter ) DISTI_METHOD_OVERRIDE;
252 /// \copydoc DisplayObject::Resource
254 /// \copydoc DisplayObject::SetAvailableAttributes
256 /// \copydoc DisplayObject::CloneObject
258 /// \copydoc DisplayObject::CopyProperties
260#ifndef GLES
261 /// \copydoc DisplayObject::GetCppInterfaceDescription
262 virtual GLSGEN_GLS3DCABLE_EXPORT InterfaceListType* GetCppInterfaceDescription( InterfaceListType* addToThisList = NULL ) DISTI_METHOD_OVERRIDE;
263 /// \copydoc DisplayObject::GetCppInterfaceDescriptionFree
264 virtual GLSGEN_GLS3DCABLE_EXPORT void GetCppInterfaceDescriptionFree( InterfaceListType* array ) DISTI_METHOD_OVERRIDE;
265#endif
266 /// \copydoc DisplayObject::PreDraw
268 /// \copydoc DisplayObject::Draw
270 /// \copydoc DisplayObject::Calculate
272 /// \copydoc DisplayObject::handle
274 /// \copydoc DisplayObject::SetValue
275 virtual GLSGEN_GLS3DCABLE_EXPORT void SetValue( int spec, va_list& args ) DISTI_METHOD_OVERRIDE;
276 /// \copydoc Group::CalculateBoundingBox
278 /// \copydoc DisplayObject::Hit
279 virtual GLSGEN_GLS3DCABLE_EXPORT bool Hit( float x, float y, float z, float scale, const Vector& directionVector, Vector* collisionPoint ) DISTI_METHOD_OVERRIDE;
280
281 /// \copydoc DisplayObject::Pick3D
282 virtual GLSGEN_GLS3DCABLE_EXPORT DisplayObject* Pick3D( const Vector& winLoc, const Vector& logicalCoords, float scale,
283 const Vector& directionVector, Vector& collisionWinLoc, const OpenGLMatrices& drawnMatrices ) DISTI_METHOD_OVERRIDE;
284
285 /// \copydoc DisplayObject::CalculateTextureCoordinates
287 /// \copydoc DisplayObject::LineWidth(float)
289 /// \copydoc DisplayObject::LineWidth()
291 /// \copydoc DisplayObject::LineStipplePattern(int)
293 /// \copydoc DisplayObject::LineStipplePattern()
295 /// \copydoc DisplayObject::LineStippleMultiplier(int)
297 /// \copydoc DisplayObject::LineStippleMultiplier()
299 /// \copydoc DisplayObject::PolygonMode()
301 /// \copydoc DisplayObject::PolygonMode(int)
303 /// \copydoc DisplayObject::PolygonEnd(const int)
305 /// \copydoc DisplayObject::PolygonEnd()
307 /// \copydoc DisplayObject::Shading(const int)
308 virtual GLSGEN_GLS3DCABLE_EXPORT void Shading( const int shading ) DISTI_METHOD_OVERRIDE;
309 /// \copydoc DisplayObject::Shading()
311 /// \copydoc DisplayObject::DepthTest(unsigned char)
312 virtual GLSGEN_GLS3DCABLE_EXPORT void DepthTest( unsigned char zbuf ) DISTI_METHOD_OVERRIDE;
313 /// \copydoc DisplayObject::DepthTest()
315 /// \copydoc DisplayObject::AntiAlias(bool)
317 /// \copydoc DisplayObject::AntiAlias()
319 /// \copydoc DisplayObject::AlphaMode(int)
321 /// \copydoc DisplayObject::AlphaMode()
323 /// \copydoc DisplayObject::CullBackFace(const bool)
325 /// \copydoc DisplayObject::CullBackFace()
327 /// \copydoc DisplayObject::LightingEnabled()
329 /// \copydoc DisplayObject::LightingEnabled(bool)
331 /// \copydoc DisplayObject::SetBlendColor(const GlsColor&)
333 /// \copydoc DisplayObject::GetBlendColor()
335 /// \copydoc DisplayObject::SetColor(const GlsColor&)
337 /// \copydoc DisplayObject::GetColor()
339 /// \copydoc DisplayObject::SetFillColor(const GlsColor&)
341 /// \copydoc DisplayObject::GetFillColor()
343 /// \copydoc DisplayObject::TextureRepeat(const int)
345 /// \copydoc DisplayObject::TextureRepeat()
347 /// \copydoc DisplayObject::TextureMappingTechnique(const int)
349 /// \copydoc DisplayObject::TextureMappingTechnique()
351 /// \copydoc DisplayObject::TextureMinificationFilter(const int)
353 /// \copydoc DisplayObject::TextureMinificationFilter()
355 /// \copydoc DisplayObject::TextureMagnificationFilter(const int)
357 /// \copydoc DisplayObject::TextureMagnificationFilter()
359
360 //////////////////////////////////////////////////
361 // Gls3DCable specific operations
362 //////////////////////////////////////////////////
363
364 /** Sets flexibility.
365 * \param value Controls how stiff the cable is. The value should be in the
366 range of 0 to 1, inclusive. 0 is very inflexible, while 1 is very flexible.
367 \pre value must be in the range of 0 to 1
368 \post None
369 */
370 GLSGEN_GLS3DCABLE_EXPORT void Flexibility( const float& value );
371 /** Gets flexibility.
372 * \return How stiff the cable is.
373 */
375
376 /** Sets Number of Segements.
377 * \param value The number of cylindrical segments that will traverse
378 * the entire length of the cable. A cable with one section
379 * (that is, with only two control objects) would be a straight cylinder
380 * connecting two points, incapable of bending.
381 * The higher this number, the smoother your cable will appear.
382 \pre value must be in the range MIN_SEGEMENTS to MAX_SEGEMENTS
383 \post none
384 */
385 GLSGEN_GLS3DCABLE_EXPORT void NumberOfSegments( const unsigned int& value );
386
387 /** Gets the Number of Segements.
388 * \return The Number of Segments
389 */
391
392 /** Sets the Number Of Sides.
393 * \param value The number of sides the cable "tube" will have.
394 * The more sides, the smoother the cable will appear.
395 * A value of two will produce a ribbon-like cable.
396 * A value of one will render only a line.
397 \pre value must be in the range of 1 to 100 inclusive.
398 \post None
399 */
400 GLSGEN_GLS3DCABLE_EXPORT void NumberOfSides( const unsigned int& value );
401
402 /** Gets the Number of Sides.
403 * \return The number of sides
404 */
406
407 /** Sets the Radius of the cable in logical units
408 \param value The radius in logical units.
409 \pre value must be plus/minus MAX_FLT
410 \post none
411 */
412 GLSGEN_GLS3DCABLE_EXPORT void Radius( const float& value );
413
414 /** Gets the Radius of the cable
415 * \return The radius in logical units
416 */
418
419 /** Sets the Length of the cable.
420 * when not under duress (the cable will stretch when the end-points
421 * are moved too far from each other).
422 * \param value The approximate length of the cable in logical units
423 \pre value must be 0.0 to MAX_FLT
424 \post None
425 */
426 GLSGEN_GLS3DCABLE_EXPORT void Length( const float& value );
427
428 /** Gets the Length of the cable.
429 * \return The length of the cable in logical units
430 */
432
433 /** Sets the CollisionStyle.
434 * \param value The collision mode for the cable.
435 * COLLISIONSTYLE_NONE will disable all collision detection and
436 * therefore any cable deformation caused thereby.
437 * COLLISIONSTYLE_FAST will check for collisions with other objects in
438 * the scene, but will only move / orient the cable midpoint such that it
439 * appears as though the cable is laying flat on a single surface.
440 *
441 * Check if USE_COLLISIONSTYLE_SLOW is defined before using Slow.
442 */
443 GLSGEN_GLS3DCABLE_EXPORT void CollisionStyle( const int& value );
444
445 /** Gets the Collision Style
446 * \return The current Collision Style
447 */
449
450 /** Sets the Slack Percentage
451 * \param section Which section of the cable, 0 based
452 * \param pct The percent of the slace (0.0 -> 1.0)
453 * This will adjust the slack percentage in the cable for the section,
454 * the caller must ensure that all percents sum up to 1.0.
455 \pre section must be < _sectionSlackPct.Count(), and pct must be 0.0-1.0
456 \post Slack percentage will not change if preconditions are not met.
457 */
458 GLSGEN_GLS3DCABLE_EXPORT void SlackPct( unsigned int section, double pct );
459
460 /** Gets the Slack Percentage for a particular section
461 * \param section The section of interest.
462 * \return The slack percentage for the specified section.
463 \pre section must be < _sectionSlackPct.Count()
464 \post if preconditions are not met 0.0 is returned
465 */
466 GLSGEN_GLS3DCABLE_EXPORT double SlackPct( unsigned int section );
467
468 /**
469 How many Slack Sections are there? Can be used with SlackPct() to
470 get set Slack Sections.
471 \return Return the number of Slack Sections, 0 to N
472 \pre none
473 \post none
474 */
476
477 /**
478 Sometimes an outside source may need to recalculate the cable, such as
479 when the scene changes and the cable may not be colliding with another
480 object in the scene.
481 \pre None
482 \post None
483 */
485
486 /// Whether or not to simulate gravity on the cable.
487 /// \param value The new gravity flag value.
488 GLSGEN_GLS3DCABLE_EXPORT void Gravity( const bool& value );
489
490 /**
491 Returns wether or not gavity is simulated on the cable.
492 \return Returns wether or not gavity is simulated on the cable
493 \pre none
494 \post none
495 */
497 {
498 return _gravity;
499 }
500
501private:
502 /**
503 Reallocate, but do not set the vertices that make up the cable line
504 \pre None
505 \post Will clear _needNewLineVerts, and will set _needCableRecalc
506 */
507 void AllocateLineVertices();
508
509 /**
510 \param *root Pointer to a list of objects to search for a collision
511 \param &pos Starting point of the ray
512 \param &vec Direction vector of the ray
513 \param *mag_pct_chg If a float pointer is provided, this will return the percent
514 change between the new/old Ray magnitude.
515 This is an optional parameter.
516 \return Return true if the new magnitude is smaller than the old
517 \pre root must exist
518 \post
519 */
520 bool RaycastAdjusted( DisplayObject* root, Vector& pos, Vector& vec, float* mag_pct_chg = NULL );
521
522 /**
523 Determine if something is colliding with the cable.
524 \param *root Pointer to a list of objects to search for a collision
525 \param x The x starting location of the ray
526 \param y The y starting location of the ray
527 \param z The z starting location of the ray
528 \param scale The Scale factor of the window
529 \param directionVector Direction vector of the ray
530 \param &collideDist Return the distance to the collision point from the start point
531 \param *collisionPoint Return the closest collision point
532 \return true if a hit occurs
533 \pre root must exist
534 \post None
535 */
536 bool GlobalHit( DisplayObject* root, float x, float y, float z, float scale, const Vector& directionVector, float& collideDist, Vector* collisionPoint );
537
538 /**
539 Recompute the line vertices of the cable.
540 \return success or failure
541 \pre
542 \post will clear _needCableRecalc
543 */
544 bool RecalculateCable();
545
546 /**
547 Fill out/calculate the cable mesh.
548 \pre None
549 \post None
550 */
551 void TubeGeneration();
552
553protected:
554 /**
555 How flexibile is the cable, more flexibility gives a more rounded cable
556 This has a range of 0 to 1, 0 is inflexible, 1 is flexible.
557 */
559
560 /**
561 The number of pieces that the entire cable has, the more
562 segements the more smooth a cable will appear, e.g., 1 segment
563 gives you a straight line, two gives you a 'V', etc.
564 This has a range of MIN_SEGEMENTS to MAX_SEGEMENTS
565 */
566 unsigned int _numberOfSegments;
567
568 /**
569 How many sides does the cable have. 1 is a wire
570 2 is a ribbon cable, 3 a triangle, 4 a sqaure, etc. the more
571 sides the closer to a circle you get.
572 This has a range of MIN_NUMBER_OF_SIDES to MAX_NUMBER_OF_SIDES.
573 */
574 unsigned int _numberOfSides;
575
576 /**
577 The Radius of the cable. Units are in pixels.
578 This has a range of plus/minus FLT_MAX
579 */
580 float _radius;
581
582 /**
583 The requested length of the cable, the cable may be longer, if needed to
584 reach between the end points. A zero length cable can be used to "hide"
585 the cable, while leaving the end points intact. Units are in logical units.
586 This has a range of zero to FLT_MAX.
587 */
588 float _length;
589
590 /**
591 Does RecalculateCable () need to be called next frame?
592 */
594
595 /**
596 Does TubeGeneration () need to be called next frame?
597 */
599
600 /**
601 Prevents "Hit()" from being called from within RecalculateCable()
602 */
604
605 /**
606 The _lineVerts are stored in the _line object. The _line object is used
607 for drawing if sides == 1.
608 */
610
611 /**
612 The Mesh Verts, Normals, and TexCoords are stored in this object. The _mesh object
613 is used for drawing when sides > 1.
614 */
616
617 /**
618 Stores the locations of all of the "EndPoint" objects for ease of use in future calculations.
619 Also used to check if any of the positions have changed.
620 Endpoints, can be in the middle section of the cable, by "endpoints" it is meant the ends of the sections.
621 */
622 std::vector<Vector> _endPointPos;
623
624 /**
625 Stores the dcs orientations of all of the "EndPoint" objects for ease of use in future calculations.
626 Also used to check if any of the orientations have changed.
627 Endpoints, can be in the middle section of the cable, by "endpoints" it is meant the ends of the sections.
628 */
629 std::vector<GlsMatrixAffineD> _endPointOri;
630
631 /**
632 The percentage of slack that each cable segment has (starts out equally divided)...
633 but the User can set the percentages.
634 This has a range of >= 0 and <= 1. The total of all sections should add to 1.
635 */
637
638 /**
639 Store the DCS Rotation matrix used to calculate the mesh object. The
640 Z is the direction of gravity, so this will effect the slack in the cable.
641 Compare this old DCS with the current to determine if we need to recalculate
642 the mesh.
643 */
645
646 /**
647 The collision type.
648 */
650
651 bool _gravity; ///< If true, gravity will be simulated on this cable.
652
653 /// The number of vertices in the cable line, for each section of the cable.
654 /// This INCLUDES the first vertex and the last vertex of each section.
656
657 /// This will be the summed arc length for all sections.
658 /// It is stored because it is used for tube generation.
660
661private:
662 // Disable implicit generated Members
663 Gls3DCable& operator=( const Gls3DCable& rhs ) DISTI_SPECIAL_MEM_FUN_DELETE;
665};
666
667} // namespace disti
668
669#endif
Definition: cull.h:50
Definition: events.h:113
Definition: display.h:96
Definition: disti_metadata.h:220
The Polygon class. Implements Polygons.
Definition: glpolygon.h:56
The glTriMesh class. Implements Triangle Meshes.
Definition: gltrimesh.h:95
Definition: gls_3d_cable.h:190
virtual void CalculateTextureCoordinates() DISTI_METHOD_OVERRIDE
void SlackPct(unsigned int section, double pct)
virtual void SetAvailableAttributes(unsigned int value) DISTI_METHOD_OVERRIDE
virtual int LineStipplePattern() DISTI_METHOD_OVERRIDE
virtual void Draw() DISTI_METHOD_OVERRIDE
virtual int TextureMagnificationFilter() DISTI_METHOD_OVERRIDE
virtual int PolygonEnd() DISTI_METHOD_OVERRIDE
bool Gravity()
Definition: gls_3d_cable.h:496
virtual void CalculateBoundingBox() DISTI_METHOD_OVERRIDE
float _radius
Definition: gls_3d_cable.h:580
bool _gravity
If true, gravity will be simulated on this cable.
Definition: gls_3d_cable.h:651
virtual void SetColor(const GlsColor &color) DISTI_METHOD_OVERRIDE
GlsMatrixAffineD _cableDcs
Definition: gls_3d_cable.h:644
float _length
Definition: gls_3d_cable.h:588
virtual DisplayObject * CloneObject(bool generateNames=false) DISTI_METHOD_OVERRIDE
Gls3DCable(bool generateInstance=false)
virtual void SetBlendColor(const GlsColor &color) DISTI_METHOD_OVERRIDE
virtual int TextureMinificationFilter() DISTI_METHOD_OVERRIDE
virtual bool CullBackFace() DISTI_METHOD_OVERRIDE
virtual GlsColor GetColor() DISTI_METHOD_OVERRIDE
virtual bool Hit(float x, float y, float z, float scale, const Vector &directionVector, Vector *collisionPoint) DISTI_METHOD_OVERRIDE
bool _needTubeGeneration
Definition: gls_3d_cable.h:598
virtual DisplayObject * handle(DisplayEvent *ev) DISTI_METHOD_OVERRIDE
virtual int LineStippleMultiplier() DISTI_METHOD_OVERRIDE
virtual void SetValue(int spec, va_list &args) DISTI_METHOD_OVERRIDE
virtual GlsColor GetBlendColor() DISTI_METHOD_OVERRIDE
virtual void PreDraw(const OpenGLMatrices &current, Culler &culler) DISTI_METHOD_OVERRIDE
virtual void GetResources(std::ostream &outstr, GlsResourceFilter *filter) DISTI_METHOD_OVERRIDE
virtual bool TextureRepeat() DISTI_METHOD_OVERRIDE
bool _inCableRecalc
Definition: gls_3d_cable.h:603
unsigned int _numberOfSides
Definition: gls_3d_cable.h:574
ECollisionStyle _collisionStyle
Definition: gls_3d_cable.h:649
unsigned int SlackSectionCount() const
virtual int PolygonMode() DISTI_METHOD_OVERRIDE
unsigned int NumberOfSegments()
virtual int Shading() DISTI_METHOD_OVERRIDE
virtual void Calculate(double time) DISTI_METHOD_OVERRIDE
static DisplayObject * CreateInstance()
Gls3DCable(const Gls3DCable &that, const bool generateNames)
GLTriMesh _mesh
Definition: gls_3d_cable.h:615
virtual int DepthTest() DISTI_METHOD_OVERRIDE
float _flexibility
Definition: gls_3d_cable.h:558
virtual DistiAttributeBase & Resource(const char *name) DISTI_METHOD_OVERRIDE
GLPolygon _line
Definition: gls_3d_cable.h:609
virtual ~Gls3DCable()
virtual int TextureMappingTechnique() DISTI_METHOD_OVERRIDE
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &drawnMatrices) DISTI_METHOD_OVERRIDE
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
DynamicDoubleArray _sectionSlackPct
Definition: gls_3d_cable.h:636
float _realCableLength
Definition: gls_3d_cable.h:659
virtual bool AntiAlias() DISTI_METHOD_OVERRIDE
ECollisionStyle
Collision model.
Definition: gls_3d_cable.h:217
virtual bool LightingEnabled() DISTI_METHOD_OVERRIDE
virtual GlsColor GetFillColor() DISTI_METHOD_OVERRIDE
unsigned int _numberOfSegments
Definition: gls_3d_cable.h:566
virtual float LineWidth() DISTI_METHOD_OVERRIDE
std::vector< Vector > _endPointPos
Definition: gls_3d_cable.h:622
virtual void SetFillColor(const GlsColor &color) DISTI_METHOD_OVERRIDE
int _lineVertsPerSection
Definition: gls_3d_cable.h:655
unsigned int NumberOfSides()
bool _needCableRecalc
Definition: gls_3d_cable.h:593
std::vector< GlsMatrixAffineD > _endPointOri
Definition: gls_3d_cable.h:629
virtual int AlphaMode() DISTI_METHOD_OVERRIDE
Definition: gls_color.h:54
Definition: gls_resources.h:51
Definition: group.h:53
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:544
Definition: gls_3d_cable.h:93
bool operator==(const VertexNoColor &arg) const
Definition: gls_3d_cable.h:167
void NearZero()
Definition: gls_3d_cable.h:118
PreciseVertex(float x, float y, float z)
Definition: gls_3d_cable.h:109
bool operator!=(const VertexNoColor &arg) const
Definition: gls_3d_cable.h:177
void Normalize()
Definition: gls_3d_cable.h:139
PreciseVertex(const Vector &vector)
Definition: gls_3d_cable.h:101
Definition: vertex.h:85
float y
The Y component.
Definition: vertex.h:88
VertexNoColor()
Definition: vertex.h:92
float x
The X component.
Definition: vertex.h:87
float Magnitude() const
Definition: vertex.h:330
float z
The Z component.
Definition: vertex.h:89
The disti::GLPolygon class. Implements Polygons.
#define GLSGEN_GLS3DCABLE_EXPORT
Provides support for creating DLLs.
Definition: gls_3d_cable.h:60
The gls_auto_lib.
Macros and helper code to determine what subset of C++11/14/17 is available.
#define DISTI_SPECIAL_MEM_FUN_DELETE
Macro to wrap function deletion, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:246
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:488
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:222
The disti::GlsQuaternion class.
The disti::GLTriMesh class. Implements Triangle Meshes.
The disti::Group class. Implements groups of objects.
Definition: bmpimage.h:47
bool BETWEEN(const X &x, const X1 &x1, const X2 &x2)
Definition: util.h:131
DynamicArray< double > DynamicDoubleArray
Typedef for dynamic array of slack percentages.
Definition: gls_3d_cable.h:89
DistiAttribDict::const_iterator end(const DistiAttribDict &dict)
Definition: disti_metadata.h:975