53 #if (defined(GLSGEN_EXPORT_GLS3DCABLE) || \
54 defined(GLSGEN_IMPORT_GLS3DCABLE) || \
55 defined(GLS_EXPORT_GENERATED) || \
56 defined(GLS_IMPORT_GENERATED)) \
58 # if defined(GLSGEN_EXPORT_GLS3DCABLE) || defined(GLS_EXPORT_GENERATED)
59 # define GLSGEN_GLS3DCABLE_EXPORT __declspec(dllexport)
61 # define GLSGEN_GLS3DCABLE_EXPORT __declspec(dllimport)
64 # define GLSGEN_GLS3DCABLE_EXPORT
69 #define LIB_BASE_NAME "gls_3d_cable"
80 GLS_3DCABLE_FIRST_VALUE = GLS_LAST_INITIALIZER+1,
82 GLS_3DCABLE_FLEXIBILITY,
83 GLS_3DCABLE_NUMBEROFSEGMENTS,
84 GLS_3DCABLE_NUMBEROFSIDES,
88 GLS_3DCABLE_SECTIONSLACKPCT,
89 GLS_3DCABLE_SECTIONFLOORDIST,
90 GLS_3DCABLE_COLLISIONSTYLE,
91 GLS_3DCABLE_FILLCOLOR,
95 typedef DynamicArray<double, false> DynamicDoubleArray;
118 const float DIFF = 0.0001f;
120 if (BETWEEN(x, 0.0 - DIFF, 0.0 + DIFF))
125 if (BETWEEN(y, 0.0 - DIFF, 0.0 + DIFF))
130 if (BETWEEN(z, 0.0 - DIFF, 0.0 + DIFF))
143 const double DIFF = 0.0001;
145 if (!BETWEEN(length, 0.0 - DIFF, 0.0 + DIFF))
148 double inv_length = 1.0/ length;
150 x = float(x * inv_length);
151 y = float(y * inv_length);
152 z = float(z * inv_length);
168 const double DIFF = 0.0001;
169 return (BETWEEN(x , arg.x - DIFF, arg.x + DIFF) &&
170 BETWEEN(y , arg.y - DIFF, arg.y + DIFF) &&
171 BETWEEN(z , arg.z - DIFF, arg.z + DIFF));
180 const double DIFF = 0.0001;
181 return (!BETWEEN(x , arg.x - DIFF, arg.x + DIFF) ||
182 !BETWEEN(y , arg.y - DIFF, arg.y + DIFF) ||
183 !BETWEEN(z , arg.z - DIFF, arg.z + DIFF));
200 TEXTUREPOINT_MULT = 50
206 MIN_NUMBER_OF_SIDES = 1,
207 MAX_NUMBER_OF_SIDES = 100
214 MAX_SEGEMENTS = 10000
219 COLLISIONSTYLE_NONE = 0,
221 #if defined(USE_COLLISIONSTYLE_SLOW)
226 friend class Gls3DCableEditor;
232 GLSGEN_GLS3DCABLE_EXPORT
Gls3DCable(
bool generateInstance=
false);
238 GLSGEN_GLS3DCABLE_EXPORT
Gls3DCable(
const Gls3DCable& that,
const bool generateNames );
243 static GLSGEN_GLS3DCABLE_EXPORT
DisplayObject* CreateInstance();
263 virtual GLSGEN_GLS3DCABLE_EXPORT
void Draw(
void);
265 virtual GLSGEN_GLS3DCABLE_EXPORT
void Calculate(
double time);
269 virtual GLSGEN_GLS3DCABLE_EXPORT
void SetValue(
int spec,va_list &args);
271 virtual GLSGEN_GLS3DCABLE_EXPORT
void CalculateBoundingBox(
void);
285 virtual GLSGEN_GLS3DCABLE_EXPORT
bool Hit(
float x,
float y,
float z,
float scale,
const Vector& directionVector,
Vector *collisionPoint);
292 virtual GLSGEN_GLS3DCABLE_EXPORT
void LineWidth(
float width);
293 virtual GLSGEN_GLS3DCABLE_EXPORT
float LineWidth(
void);
301 virtual GLSGEN_GLS3DCABLE_EXPORT
int PolygonMode(
void);
302 virtual GLSGEN_GLS3DCABLE_EXPORT
void PolygonMode(
int mode);
304 virtual GLSGEN_GLS3DCABLE_EXPORT
void PolygonEnd(
const int mode);
305 virtual GLSGEN_GLS3DCABLE_EXPORT
int PolygonEnd(
void);
307 virtual GLSGEN_GLS3DCABLE_EXPORT
void Shading(
const int mode);
308 virtual GLSGEN_GLS3DCABLE_EXPORT
int Shading(
void);
310 virtual GLSGEN_GLS3DCABLE_EXPORT
void DepthTest(
unsigned char mode);
311 virtual GLSGEN_GLS3DCABLE_EXPORT
int DepthTest(
void);
313 virtual GLSGEN_GLS3DCABLE_EXPORT
void AntiAlias(
bool mode);
314 virtual GLSGEN_GLS3DCABLE_EXPORT
bool AntiAlias(
void);
316 virtual GLSGEN_GLS3DCABLE_EXPORT
void AlphaMode(
int mode);
317 virtual GLSGEN_GLS3DCABLE_EXPORT
int AlphaMode(
void);
319 virtual GLSGEN_GLS3DCABLE_EXPORT
void CullBackFace(
const bool mode);
320 virtual GLSGEN_GLS3DCABLE_EXPORT
bool CullBackFace(
void);
334 virtual GLSGEN_GLS3DCABLE_EXPORT
void TextureRepeat(
const int rep);
357 GLSGEN_GLS3DCABLE_EXPORT
void Flexibility (
const float& value);
387 GLSGEN_GLS3DCABLE_EXPORT
void NumberOfSides (
const unsigned int& value);
399 GLSGEN_GLS3DCABLE_EXPORT
void Radius (
const float& value);
404 GLSGEN_GLS3DCABLE_EXPORT
float Radius ();
413 GLSGEN_GLS3DCABLE_EXPORT
void Length (
const float& value);
418 GLSGEN_GLS3DCABLE_EXPORT
float Length ();
445 GLSGEN_GLS3DCABLE_EXPORT
void SlackPct (
unsigned int section,
double pct);
453 GLSGEN_GLS3DCABLE_EXPORT
double SlackPct (
unsigned int section);
481 GLSGEN_GLS3DCABLE_EXPORT
void Gravity (
const bool& value)
504 void AllocateLineVertices ();
533 bool GlobalHit(
DisplayObject *root,
float x,
float y,
float z,
float scale,
const Vector& directionVector,
float &collideDist,
Vector *collisionPoint);
541 bool RecalculateCable ();
548 void TubeGeneration ();
653 int _lineVertsPerSection;
657 float _realCableLength;
662 Gls3DCable& operator=(
const Gls3DCable &rhs ) DISTI_SPECIAL_MEM_FUN_DELETE;
663 Gls3DCable(
const Gls3DCable &src ) DISTI_SPECIAL_MEM_FUN_DELETE;
float _radius
Definition: gls_3d_cable.h:578
virtual int LineStippleMultiplier(void)
virtual DisplayObject * CloneObject(bool generateNames=false)
float _length
Definition: gls_3d_cable.h:586
virtual bool LightingEnabled()
virtual int PolygonMode(void)
virtual void Normalize(void)
Definition: gls_3d_cable.h:138
virtual int AlphaMode(void)
virtual void Calculate(double time)
Definition: dynamic_array.h:63
The disti::Group class. Implements groups of objects.
Class to contain current OpenGL view, projection and draw matrices.
Definition: util.h:281
bool _needTubeGeneration
Definition: gls_3d_cable.h:596
virtual glsColor GetBlendColor(void)
Definition: gls_3d_cable.h:193
The Polygon class. Implements Polygons.
Definition: glpolygon.h:56
virtual int TextureMappingTechnique(void)
virtual DistiAttributeBase & Resource(const char *name)
unsigned int NumberOfSegments()
virtual int LineStipplePattern(void)
The disti::GLPolygon class. Implements Polygons.
unsigned int _numberOfSegments
Definition: gls_3d_cable.h:564
bool operator!=(const VertexNoColor &arg) const
Definition: gls_3d_cable.h:178
virtual InterfaceListType * GetCppInterfaceDescription(InterfaceListType *addToThisList=NULL)
Gls3DCable(bool generateInstance=false)
VertexNoColor()
Definition: vertex.h:91
virtual bool Hit(float x, float y, float z, float scale, const Vector &directionVector, Vector *collisionPoint)
GlsMatrixAffineD _cableDcs
Definition: gls_3d_cable.h:642
bool _inCableRecalc
Definition: gls_3d_cable.h:601
virtual void SetFillColor(const glsColor &color)
DynamicDoubleArray _sectionSlackPct
Definition: gls_3d_cable.h:634
The glTriMesh class. Implements Triangle Meshes.
Definition: gltrimesh.h:93
std::vector< Vector > _endPointPos
Definition: gls_3d_cable.h:620
virtual int DepthTest(void)
virtual float LineWidth(void)
float _flexibility
Definition: gls_3d_cable.h:556
GLTriMesh _mesh
Definition: gls_3d_cable.h:613
unsigned int SlackSectionCount() const
std::vector< GlsMatrixAffineD > _endPointOri
Definition: gls_3d_cable.h:627
virtual void CopyProperties(DisplayObject *src)
bool _needCableRecalc
Definition: gls_3d_cable.h:591
unsigned int _numberOfSides
Definition: gls_3d_cable.h:572
virtual void SetValue(int spec, va_list &args)
Definition: disti_metadata.h:179
virtual glsColor GetFillColor(void)
unsigned int NumberOfSides()
void ForceCableRecalc()
Definition: gls_3d_cable.h:471
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 void CalculateTextureCoordinates(void)
virtual glsColor GetColor(void)
virtual bool TextureRepeat(void)
Definition: gls_color.h:54
virtual void SetBlendColor(const glsColor &color)
virtual int TextureMinificationFilter(void)
void Gravity(const bool &value)
Definition: gls_3d_cable.h:481
virtual void PreDraw(const OpenGLMatrices &parentMatrices, Culler &culler)
bool Gravity()
Definition: gls_3d_cable.h:492
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:290
virtual void NearZero()
Definition: gls_3d_cable.h:116
virtual void GetCppInterfaceDescriptionFree(InterfaceListType *array)
GLPolygon _line
Definition: gls_3d_cable.h:607
Definition: gls_resources.h:50
virtual void SetColor(const glsColor &color)
Macros and helper code to determine what subset of C++11/14/17 is available.
virtual bool operator==(const VertexNoColor &arg) const
Definition: gls_3d_cable.h:166
ECollisionStyle _collisionStyle
Definition: gls_3d_cable.h:647
Definition: bmpimage.h:46
virtual int PolygonEnd(void)
virtual void GetResources(std::ostream &outstr, GlsResourceFilter *filter)
virtual DisplayObject * handle(DisplayEvent *ev)
Definition: gls_3d_cable.h:97
Definition: gls_matrix_affine.h:61
virtual bool AntiAlias(void)
The disti::GLTriMesh class. Implements Triangle Meshes.
virtual int TextureMagnificationFilter(void)