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