18 :
SLMesh(assetMgr,
"Coord-Axis-Arrow Mesh")
39 SLushort i = 0, v1 = 0, v2 = 0,
v3 = 0, v4 = 0;
45 P.push_back(
SLVec3f( t, t, t)); v1=i; i++;
46 P.push_back(
SLVec3f( t,1-h, t)); v2=i; i++;
48 P.push_back(
SLVec3f( t, t,-t)); v4=i; i++;
49 I16.push_back(v1);
I16.push_back(
v3);
I16.push_back(v2);
50 I16.push_back(v1);
I16.push_back(v4);
I16.push_back(
v3);
52 P.push_back(
SLVec3f(-t, t, t)); v1=i; i++;
53 P.push_back(
SLVec3f(-t,1-h, t)); v2=i; i++;
55 P.push_back(
SLVec3f( t, t, t)); v4=i; i++;
56 I16.push_back(v1);
I16.push_back(
v3);
I16.push_back(v2);
57 I16.push_back(v1);
I16.push_back(v4);
I16.push_back(
v3);
59 P.push_back(
SLVec3f(-t, t,-t)); v1=i; i++;
60 P.push_back(
SLVec3f(-t,1-h,-t)); v2=i; i++;
62 P.push_back(
SLVec3f(-t, t, t)); v4=i; i++;
63 I16.push_back(v1);
I16.push_back(
v3);
I16.push_back(v2);
64 I16.push_back(v1);
I16.push_back(v4);
I16.push_back(
v3);
66 P.push_back(
SLVec3f( t, t,-t)); v1=i; i++;
67 P.push_back(
SLVec3f( t,1-h,-t)); v2=i; i++;
69 P.push_back(
SLVec3f(-t, t,-t)); v4=i; i++;
70 I16.push_back(v1);
I16.push_back(
v3);
I16.push_back(v2);
71 I16.push_back(v1);
I16.push_back(v4);
I16.push_back(
v3);
73 P.push_back(
SLVec3f( w,1-h, w)); v1=i; i++;
74 P.push_back(
SLVec3f( 0, 1, 0)); v2=i; i++;
76 I16.push_back(v1);
I16.push_back(
v3);
I16.push_back(v2);
78 P.push_back(
SLVec3f( w,1-h, w)); v1=i; i++;
79 P.push_back(
SLVec3f(-w,1-h, w)); v2=i; i++;
81 I16.push_back(v1);
I16.push_back(
v3);
I16.push_back(v2);
82 P.push_back(
SLVec3f(-w,1-h, w)); v1=i; i++;
83 P.push_back(
SLVec3f(-w,1-h,-w)); v2=i; i++;
85 I16.push_back(v1);
I16.push_back(
v3);
I16.push_back(v2);
87 P.push_back(
SLVec3f(-w,1-h,-w)); v1=i; i++;
88 P.push_back(
SLVec3f( w,1-h,-w)); v2=i; i++;
90 I16.push_back(v1);
I16.push_back(
v3);
I16.push_back(v2);
92 P.push_back(
SLVec3f( w,1-h, w)); v1=i; i++;
93 P.push_back(
SLVec3f( w,1-h,-w)); v2=i; i++;
95 P.push_back(
SLVec3f(-w,1-h, w)); v4=i; i++;
96 I16.push_back(v1);
I16.push_back(
v3);
I16.push_back(v2);
97 I16.push_back(v1);
I16.push_back(v4);
I16.push_back(
v3);
99 P.push_back(
SLVec3f( t, -t, t)); v1=i; i++;
100 P.push_back(
SLVec3f( t, -t,-t)); v2=i; i++;
102 P.push_back(
SLVec3f(-t, -t, t)); v4=i; i++;
103 I16.push_back(v1);
I16.push_back(
v3);
I16.push_back(v2);
104 I16.push_back(v1);
I16.push_back(v4);
I16.push_back(
v3);
SLVec3< SLfloat > SLVec3f
Toplevel holder of the assets meshes, materials, textures and shaders.
void buildMesh(SLMaterial *material=nullptr)
SLfloat _arrowHeadWidth
Width of the arrow head.
SLfloat _arrowHeadLength
Lenght of the arrow head.
SLfloat _arrowThickness
Thickness of the arrow.
SLCoordAxisArrow(SLAssetManager *assetMgr, SLMaterial *material=nullptr, SLfloat arrowThickness=0.05f, SLfloat arrowHeadLenght=0.2f, SLfloat arrowHeadWidth=0.1f)
Defines a standard CG material with textures and a shader program.
An SLMesh object is a triangulated mesh, drawn with one draw call.
SLVuint I32
Vector of vertex indices 32 bit.
SLVushort I16
Vector of vertex indices 16 bit.
SLVCol4f C
Vector of vertex colors (opt.) layout (location = 4)
SLVVec3f N
Vector for vertex normals (opt.) layout (location = 1)
SLVVec2f UV[2]
Array of 2 Vectors for tex. coords. (opt.) layout (location = 2)
SLVVec3f P
Vector for vertex positions layout (location = 0)
V3 v3(float x, float y, float z)