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"
75 GLS_3DCABLE_FIRST_VALUE = GLS_LAST_INITIALIZER + 1,
77 GLS_3DCABLE_FLEXIBILITY,
78 GLS_3DCABLE_NUMBEROFSEGMENTS,
79 GLS_3DCABLE_NUMBEROFSIDES,
83 GLS_3DCABLE_SECTIONSLACKPCT,
84 GLS_3DCABLE_SECTIONFLOORDIST,
85 GLS_3DCABLE_COLLISIONSTYLE,
86 GLS_3DCABLE_FILLCOLOR,
90 typedef DynamicArray<double> DynamicDoubleArray;
114 const float DIFF = 0.0001f;
116 if(
BETWEEN( x, 0.0 - DIFF, 0.0 + DIFF ) )
121 if(
BETWEEN( y, 0.0 - DIFF, 0.0 + DIFF ) )
126 if(
BETWEEN( z, 0.0 - DIFF, 0.0 + DIFF ) )
138 const double DIFF = 0.0001;
140 if( !
BETWEEN( length, 0.0 - DIFF, 0.0 + DIFF ) )
143 double inv_length = 1.0 / length;
145 x = float( x * inv_length );
146 y = float( y * inv_length );
147 z = float( z * inv_length );
163 const double DIFF = 0.0001;
164 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 ) );
173 const double DIFF = 0.0001;
174 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 ) );
186 DISTI_DEPRECATED(
"This identifier is forbidden by the C++ standard. Use BaseClass instead." )
192 TEXTUREPOINT_MULT = 50
198 MIN_NUMBER_OF_SIDES = 1,
199 MAX_NUMBER_OF_SIDES = 100
206 MAX_SEGEMENTS = 10000
211 COLLISIONSTYLE_NONE = 0,
213 #if defined( USE_COLLISIONSTYLE_SLOW )
219 friend class Gls3DCableEditor;
225 GLSGEN_GLS3DCABLE_EXPORT
Gls3DCable(
bool generateInstance =
false );
231 GLSGEN_GLS3DCABLE_EXPORT
Gls3DCable(
const Gls3DCable& that,
const bool generateNames );
236 static GLSGEN_GLS3DCABLE_EXPORT
DisplayObject* CreateInstance();
256 virtual GLSGEN_GLS3DCABLE_EXPORT
void Draw(
void );
258 virtual GLSGEN_GLS3DCABLE_EXPORT
void Calculate(
double time );
262 virtual GLSGEN_GLS3DCABLE_EXPORT
void SetValue(
int spec, va_list& args );
264 virtual GLSGEN_GLS3DCABLE_EXPORT
void CalculateBoundingBox(
void );
278 virtual GLSGEN_GLS3DCABLE_EXPORT
bool Hit(
float x,
float y,
float z,
float scale,
const Vector& directionVector,
Vector* collisionPoint );
285 virtual GLSGEN_GLS3DCABLE_EXPORT
void LineWidth(
float width );
286 virtual GLSGEN_GLS3DCABLE_EXPORT
float LineWidth(
void );
294 virtual GLSGEN_GLS3DCABLE_EXPORT
int PolygonMode(
void );
295 virtual GLSGEN_GLS3DCABLE_EXPORT
void PolygonMode(
int mode );
297 virtual GLSGEN_GLS3DCABLE_EXPORT
void PolygonEnd(
const int mode );
298 virtual GLSGEN_GLS3DCABLE_EXPORT
int PolygonEnd(
void );
300 virtual GLSGEN_GLS3DCABLE_EXPORT
void Shading(
const int mode );
301 virtual GLSGEN_GLS3DCABLE_EXPORT
int Shading(
void );
303 virtual GLSGEN_GLS3DCABLE_EXPORT
void DepthTest(
unsigned char mode );
304 virtual GLSGEN_GLS3DCABLE_EXPORT
int DepthTest(
void );
306 virtual GLSGEN_GLS3DCABLE_EXPORT
void AntiAlias(
bool mode );
307 virtual GLSGEN_GLS3DCABLE_EXPORT
bool AntiAlias(
void );
309 virtual GLSGEN_GLS3DCABLE_EXPORT
void AlphaMode(
int mode );
310 virtual GLSGEN_GLS3DCABLE_EXPORT
int AlphaMode(
void );
312 virtual GLSGEN_GLS3DCABLE_EXPORT
void CullBackFace(
const bool mode );
313 virtual GLSGEN_GLS3DCABLE_EXPORT
bool CullBackFace(
void );
316 virtual GLSGEN_GLS3DCABLE_EXPORT
void LightingEnabled(
bool lighting );
327 virtual GLSGEN_GLS3DCABLE_EXPORT
void TextureRepeat(
const int rep );
349 GLSGEN_GLS3DCABLE_EXPORT
void Flexibility(
const float& value );
364 GLSGEN_GLS3DCABLE_EXPORT
void NumberOfSegments(
const unsigned int& value );
379 GLSGEN_GLS3DCABLE_EXPORT
void NumberOfSides(
const unsigned int& value );
391 GLSGEN_GLS3DCABLE_EXPORT
void Radius(
const float& value );
396 GLSGEN_GLS3DCABLE_EXPORT
float Radius();
405 GLSGEN_GLS3DCABLE_EXPORT
void Length(
const float& value );
410 GLSGEN_GLS3DCABLE_EXPORT
float Length();
437 GLSGEN_GLS3DCABLE_EXPORT
void SlackPct(
unsigned int section,
double pct );
445 GLSGEN_GLS3DCABLE_EXPORT
double SlackPct(
unsigned int section );
470 GLSGEN_GLS3DCABLE_EXPORT
void Gravity(
const bool& value );
489 void AllocateLineVertices();
518 bool GlobalHit(
DisplayObject* root,
float x,
float y,
float z,
float scale,
const Vector& directionVector,
float& collideDist,
Vector* collisionPoint );
526 bool RecalculateCable();
533 void TubeGeneration();
637 int _lineVertsPerSection;
641 float _realCableLength;
645 Gls3DCable& operator=(
const Gls3DCable& rhs ) DISTI_SPECIAL_MEM_FUN_DELETE;
646 Gls3DCable(
const Gls3DCable& src ) DISTI_SPECIAL_MEM_FUN_DELETE;
float _radius
Definition: gls_3d_cable.h:562
virtual int LineStippleMultiplier(void)
virtual DisplayObject * CloneObject(bool generateNames=false)
float _length
Definition: gls_3d_cable.h:570
virtual void SetColor(const GlsColor &color)
#define DISTI_DEPRECATED(msg)
Defines whether this compiler supports the C++14 deprecated attribute.
Definition: gls_cpp_lang_support.h:436
virtual bool LightingEnabled()
virtual int PolygonMode(void)
virtual int AlphaMode(void)
virtual void Calculate(double time)
Definition: dynamic_array.h:66
The disti::Group class. Implements groups of objects.
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:296
bool _needTubeGeneration
Definition: gls_3d_cable.h:580
Definition: gls_3d_cable.h:183
The Polygon class. Implements Polygons.
Definition: glpolygon.h:55
virtual int TextureMappingTechnique(void)
void Normalize(void)
Definition: gls_3d_cable.h:133
virtual GlsColor GetBlendColor(void)
virtual DistiAttributeBase & Resource(const char *name)
unsigned int NumberOfSegments()
bool BETWEEN(const X &x, const X1 &x1, const X2 &x2)
Definition: util.h:125
virtual int LineStipplePattern(void)
bool operator==(const VertexNoColor &arg) const
Definition: gls_3d_cable.h:161
The disti::GLPolygon class. Implements Polygons.
unsigned int _numberOfSegments
Definition: gls_3d_cable.h:548
bool operator!=(const VertexNoColor &arg) const
Definition: gls_3d_cable.h:171
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
Gls3DCable(bool generateInstance=false)
VertexNoColor()
Definition: vertex.h:90
virtual bool Hit(float x, float y, float z, float scale, const Vector &directionVector, Vector *collisionPoint)
void NearZero()
Definition: gls_3d_cable.h:112
GlsMatrixAffineD _cableDcs
Definition: gls_3d_cable.h:626
bool _inCableRecalc
Definition: gls_3d_cable.h:585
DynamicDoubleArray _sectionSlackPct
Definition: gls_3d_cable.h:618
The glTriMesh class. Implements Triangle Meshes.
Definition: gltrimesh.h:92
std::vector< Vector > _endPointPos
Definition: gls_3d_cable.h:604
virtual int DepthTest(void)
virtual float LineWidth(void)
float _flexibility
Definition: gls_3d_cable.h:540
GLTriMesh _mesh
Definition: gls_3d_cable.h:597
unsigned int SlackSectionCount() const
std::vector< GlsMatrixAffineD > _endPointOri
Definition: gls_3d_cable.h:611
virtual void CopyProperties(DisplayObject *src)
bool _needCableRecalc
Definition: gls_3d_cable.h:575
unsigned int _numberOfSides
Definition: gls_3d_cable.h:556
virtual void SetValue(int spec, va_list &args)
Definition: disti_metadata.h:186
unsigned int NumberOfSides()
Definition: gls_color.h:53
virtual void SetAvailableAttributes(unsigned int value)
virtual DisplayObject * Pick3D(const Vector &winLoc, const Vector &logicalCoords, float scale, const Vector &directionVector, Vector &collisionWinLoc, const OpenGLMatrices &parentDrawn)
virtual GlsColor GetColor(void)
virtual void CalculateTextureCoordinates(void)
virtual void SetBlendColor(const GlsColor &color)
virtual bool TextureRepeat(void)
virtual int TextureMinificationFilter(void)
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler)
bool Gravity()
Definition: gls_3d_cable.h:478
virtual int Shading(void)
The disti::GlsQuaternion class.
virtual bool CullBackFace(void)
void SlackPct(unsigned int section, double pct)
float Magnitude() const
Definition: vertex.h:327
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
GLPolygon _line
Definition: gls_3d_cable.h:591
Definition: gls_resources.h:50
Macros and helper code to determine what subset of C++11/14/17 is available.
ECollisionStyle _collisionStyle
Definition: gls_3d_cable.h:631
Definition: bmpimage.h:46
virtual int PolygonEnd(void)
virtual GlsColor GetFillColor(void)
virtual void GetResources(std::ostream &outstr, GlsResourceFilter *filter)
virtual void SetFillColor(const GlsColor &color)
virtual DisplayObject * handle(DisplayEvent *ev)
Definition: gls_3d_cable.h:92
Definition: gls_matrix_affine.h:60
virtual bool AntiAlias(void)
The disti::GLTriMesh class. Implements Triangle Meshes.
virtual int TextureMagnificationFilter(void)