AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RenderData.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXCOLLIDE_RENDERDATA_H
18 #define AGXCOLLIDE_RENDERDATA_H
19 
20 #include <agx/agxPhysics_export.h>
21 #include <agx/Referenced.h>
22 #include <agx/Vector.h>
23 #include <agx/Vec3.h>
24 #include <agx/Vec2.h>
25 #include <agx/agx_vector_types.h>
26 #include <agxStream/Serializable.h>
28 
29 namespace agxCollide
30 {
40  {
41  public:
42 
44  enum Mode
45  {
46 // POINTS=0,
47 // LINES=1,
48 // LINE_STRIP=2,
49 // LINE_LOOP=3,
50  TRIANGLES=4
51 // TRIANGLE_STRIP=5,
52 // TRIANGLE_FAN=6,
53 // QUADS=7,
54 // QUAD_STRIP=8,
55 // POLYGON=9,
56  };
57 
58  enum StateInfo
59  {
60  STANDARD=0x0,
61  NO_RENDER=0x1
62  };
63 
65  RenderData();
66 
68  void setRenderMaterial( agxCollide::RenderMaterial* renderMaterial );
69 
71  agxCollide::RenderMaterial *getRenderMaterial( ) const;
72 
74  bool hasRenderMaterial( ) const;
75 
77  void setVertexArray( const agx::Vec3Vector& vertices );
78 
80  const agx::Vec3Vector& getVertexArray() const;
81 
83  void setIndexArray( const agx::UInt32Vector& indices, Mode mode );
84 
86  const agx::UInt32Vector& getIndexArray() const;
87 
89  void setNormalArray( const agx::Vec3Vector& normals );
90 
92  const agx::Vec3Vector& getNormalArray( ) const;
93 
95  void setTexCoordArray( const agx::Vec2Vector& texCoords );
96 
98  const agx::Vec2Vector& getTexCoordArray( ) const;
99 
101  void setColorArray( const agx::Vec4Vector& color );
102 
104  const agx::Vec4Vector& getColorArray( ) const;
105 
106 
108  Mode getMode() const;
109 
111  void setShouldRender(bool shouldRender);
112 
114  bool getShouldRender() const;
115 
117  RenderData* clone() const;
118 
119 #ifndef SWIG
121 #endif
122 
123  protected:
124 
125  virtual ~RenderData();
126 
127 
136 
137  };
138 
139 }
140 #endif
agx::Vec4Vector m_vertexColor
Definition: RenderData.h:132
Class for storing rendering information for a Shape.
Definition: RenderData.h:39
agx::Vec3Vector m_vertices
Definition: RenderData.h:128
#define AGXPHYSICS_EXPORT
agxCollide::RenderMaterialRef m_renderMaterial
Definition: RenderData.h:133
Mode
Specifies which type of primitive this render data represents.
Definition: RenderData.h:44
Base class providing referencing counted objects.
Definition: Referenced.h:113
agx::UInt32 m_renderState
Definition: RenderData.h:134
Class for storing rendering material.
agx::Vec3Vector m_normals
Definition: RenderData.h:130
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:206
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
agx::Vec2Vector m_texCoords
Definition: RenderData.h:131
uint32_t UInt32
Definition: Integer.h:40
AGX_DECLARE_POINTER_TYPES(SpaceListener)
agx::UInt32Vector m_indices
Definition: RenderData.h:129