Class ShapeTorus
A mesh representing a torus.
Constructors
| Name | Description |
this
(majorRadius, minorRadius, majorSegments, minorSegments, owner)
|
Constructs a ShapeTorus.
|
Fields
| Name | Type | Description |
boundingBox
|
dlib.geometry.aabb.AABB | Axis-aligned bounding box for the mesh.
|
canRender
|
bool | True if OpenGL buffers are prepared and mesh can be rendered.
|
dataReady
|
bool | True if mesh data is ready for rendering.
|
eao
|
uint | OpenGL element array object for indices.
|
indices
|
uint[3][] | Array of triangle indices (each element is a uint[3]).
|
nbo
|
uint | OpenGL vertex buffer object for normals.
|
normals
|
dlib.math.vector.Vector!(float,3)[] | Array of vertex normals.
|
tbo
|
uint | OpenGL vertex buffer object for texture coordinates.
|
texcoords
|
dlib.math.vector.Vector!(float,2)[] | Array of texture coordinates.
|
vao
|
uint | OpenGL vertex array object.
|
vbo
|
uint | OpenGL vertex buffer object for positions.
|
vertices
|
dlib.math.vector.Vector!(float,3)[] | Array of vertex positions.
|
Methods
| Name | Description |
calcBoundingBox
()
|
Calculates the axis-aligned bounding box for the mesh.
|
generateNormals
()
|
Generates smooth vertex normals for the mesh based on triangle geometry.
Overwrites the normals array with computed normals.
|
getTriangle
(faceIndex)
|
Returns the triangle at the specified face index.
|
opApply
(dg)
|
Iterates over all triangles in the mesh.
|
prepareVAO
()
|
Prepares OpenGL VAO and VBOs for rendering the mesh.
Uploads vertex, normal, texcoord, and index data to the GPU.
Sets up attribute pointers and enables rendering.
|
render
(state)
|
Renders the mesh using the provided graphics pipeline state.
|