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 )
57# define GLSGEN_GLS3DCABLE_EXPORT __declspec( dllimport )
60# define GLSGEN_GLS3DCABLE_EXPORT
65#define LIB_BASE_NAME "gls_3d_cable"
74 GLS_3DCABLE_FIRST_VALUE = GLS_LAST_INITIALIZER + 1,
76 GLS_3DCABLE_FLEXIBILITY,
77 GLS_3DCABLE_NUMBEROFSEGMENTS,
78 GLS_3DCABLE_NUMBEROFSIDES,
82 GLS_3DCABLE_SECTIONSLACKPCT,
83 GLS_3DCABLE_SECTIONFLOORDIST,
84 GLS_3DCABLE_COLLISIONSTYLE,
85 GLS_3DCABLE_FILLCOLOR,
120 const float DIFF = 0.0001f;
122 if(
BETWEEN(
x, 0.0 - DIFF, 0.0 + DIFF ) )
127 if(
BETWEEN(
y, 0.0 - DIFF, 0.0 + DIFF ) )
132 if(
BETWEEN(
z, 0.0 - DIFF, 0.0 + DIFF ) )
144 const double DIFF = 0.0001;
146 if( !
BETWEEN( length, 0.0 - DIFF, 0.0 + DIFF ) )
149 double inv_length = 1.0 / length;
151 x = float(
x * inv_length );
152 y = float(
y * inv_length );
153 z = float(
z * inv_length );
169 const double DIFF = 0.0001;
179 const double DIFF = 0.0001;
192 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
198 TEXTUREPOINT_MULT = 50
204 MIN_NUMBER_OF_SIDES = 1,
205 MAX_NUMBER_OF_SIDES = 100
212 MAX_SEGEMENTS = 10000
218 COLLISIONSTYLE_NONE = 0,
220#if defined( USE_COLLISIONSTYLE_SLOW )
226 friend class Gls3DCableEditor;
453 void AllocateLineVertices();
482 bool GlobalHit(
DisplayObject* root,
float x,
float y,
float z,
float scale,
const Vector& directionVector,
float& collideDist,
Vector* collisionPoint );
490 bool RecalculateCable();
497 void TubeGeneration();
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 InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL) DISTI_METHOD_OVERRIDE
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 void GetCppInterfaceDescriptionFree(InterfaceListType *array) DISTI_METHOD_OVERRIDE
virtual int TextureMagnificationFilter() DISTI_METHOD_OVERRIDE
virtual int PolygonEnd() DISTI_METHOD_OVERRIDE
bool Gravity()
Definition: gls_3d_cable.h:442
virtual void CalculateBoundingBox() DISTI_METHOD_OVERRIDE
float _radius
Definition: gls_3d_cable.h:526
bool _gravity
If true, gravity will be simulated on this cable.
Definition: gls_3d_cable.h:597
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &parentDrawn) DISTI_METHOD_OVERRIDE
virtual void SetColor(const GlsColor &color) DISTI_METHOD_OVERRIDE
GlsMatrixAffineD _cableDcs
Definition: gls_3d_cable.h:590
float _length
Definition: gls_3d_cable.h:534
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
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler) DISTI_METHOD_OVERRIDE
bool _needTubeGeneration
Definition: gls_3d_cable.h:544
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 GetResources(std::ostream &outstr, GlsResourceFilter *filter) DISTI_METHOD_OVERRIDE
virtual bool TextureRepeat() DISTI_METHOD_OVERRIDE
bool _inCableRecalc
Definition: gls_3d_cable.h:549
unsigned int _numberOfSides
Definition: gls_3d_cable.h:520
ECollisionStyle _collisionStyle
Definition: gls_3d_cable.h:595
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:561
virtual int DepthTest() DISTI_METHOD_OVERRIDE
float _flexibility
Definition: gls_3d_cable.h:504
virtual DistiAttributeBase & Resource(const char *name) DISTI_METHOD_OVERRIDE
GLPolygon _line
Definition: gls_3d_cable.h:555
virtual int TextureMappingTechnique() DISTI_METHOD_OVERRIDE
virtual void CopyProperties(DisplayObject *src) DISTI_METHOD_OVERRIDE
DynamicDoubleArray _sectionSlackPct
Definition: gls_3d_cable.h:582
float _realCableLength
Definition: gls_3d_cable.h:605
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:512
virtual float LineWidth() DISTI_METHOD_OVERRIDE
std::vector< Vector > _endPointPos
Definition: gls_3d_cable.h:568
virtual void SetFillColor(const GlsColor &color) DISTI_METHOD_OVERRIDE
int _lineVertsPerSection
Definition: gls_3d_cable.h:601
unsigned int NumberOfSides()
bool _needCableRecalc
Definition: gls_3d_cable.h:539
std::vector< GlsMatrixAffineD > _endPointOri
Definition: gls_3d_cable.h:575
virtual int AlphaMode() DISTI_METHOD_OVERRIDE
Definition: gls_color.h:54
Definition: gls_resources.h:51
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
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
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:235
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:457
#define DISTI_METHOD_OVERRIDE
Macro to wrap the override keyword, removed on compilers that don't support it.
Definition: gls_cpp_lang_support.h:214
The disti::GlsQuaternion class.
The disti::GLTriMesh class. Implements Triangle Meshes.
The disti::Group class. Implements groups of objects.
Force inclusion of the DirectShow library.
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