Geometry

See Also

Static Variables


Name Description
vertexconfig Active VertexConfig that manages how to interpret each vertex.
localbounds LocalBounds data that's stores the local center, size, Bsphere, BBox and AABB of the Geometry.
lod_count Total amount of level of details connected to the Geometry.
primitive_count Number of primitives (triangle lists) the current Geometry currently contains.
asset Asset currently connected to the active geometry.

Variables


Name Description
vertex_array Linear array containing the active Vertex data.
weight_array Linear array containing the active Weight for every Vertex (if any).
element_array Array containing the Vertex indices order drawing the Geometry.
flags Bit mask of options assigned to the current Geometry.
lod_details Parameter used after reduction to determine the LOD that is currently visible on screen.
lod_outline Reduction setting used when generating offline LOD; this value determine the amount of silouhette to preserve.

Functions


Name Description
Cleanup Completely reset the Geometry destroying all structures, buffers and settings.
BuildVertexData Creates a linear vertex array based on the VertexConfig and vertex_array ready to be sent on the GPU.
CalculateNormals Calculate the vertex normals of the Geometry.
CalculateTangents Calculate the vertex tangents of the Geometry.
RestoreVertexArray Reload back the Geometry vertex_array from cache.
GetVertexAt Return a specific Vertex using its index as key.
GetElementAt Return the element value at a specific index location.
GetPrimitive Retrieve an existing PrimitiveData using its index as key.
BuildReductionData Generate an octree optimized for quick mesh simplification.
BuildReductionData Destroy the reduction data from memory and optinonally on disk.
GenerateLODs Generate level of details for the active Geometry.
GetLOD Retrieve a specific LOD index based on the parameters received by the function.
GetTriCount Return the amount of a triangles used by a specific LOD.
RemoveLOD Remove a specific level of detail by index.
Clear Clear the vertex and element data of the active Geometry.
ClearLODs Clear all LODs below the level pointed by index.
CalculateLocalBounds Calculate and update the local bounds of the active Geometry.
TransformPivot Transform the Geometry pivot point.
UpdateVertexConfig Apply the changes made on the Geometry VertexConfig (vertex_config).
Raycast Test the Geometry triangles against a ray.
AllocVertexArray Allocate a new vertex array.
AllocWeights Manually allocate an array of vertex weights.
AllocVertexArray Manually allocate an array of primitives.
SetPrimitive Update an existing PrimitiveData using its index as key.
Lock Prevent the Geometry to be updated by another thread.
Unlock Unlock a previously locked Geometry.
ApplyTransform Apply a specific transformation to all Geometry vertex data.
BuildSubVertexData Build a subset of the vertex data ready to be uploaded on the GPU.

Precision


The precision qualifier used throughout the API.

  • kLow: Lowest level of precision.
  • kMedium: Medium precision level.
  • kHigh: Highest level of precision.

VertexConfig


Configuration for each Vertex.

Variables


Name Description
weights Wether or not each Vertex have weights.
point_sizes true if the each Vertex have a point size associated to it.
normals Determine if each Vertex have a vertex normal.
uv_layer The number of texture coordinate associated to each Vertex.
tangents Bit mask tells the Geometry which UV layer currently have tangent available.
color_layer The number of color layer per Vertex.

LocalBounds


A structure that contains the clipping bounds of the Geometry before transformation.

Variables


Name Description
min Lower left coordinates of the axis aligned bounding box.
max Upper right coordinates of the AABB.
size The dimension of the AABB for each axis.
center Middle point of the AABB.
radius The bounding sphere radius of the Geometry.

Bounds


A structure that contains the world space clipping bounds (LocalBounds of the Geometry after transformation, including scale).

Static Variables


Name Description
min Lower left corner of the axis aligned bounding box in world space coordinates.
max Upper right corner of the axis aligned bounding box in world space coordinates.
size Dimension of the AABB for each world axis.
center Center of the axis aligned bounding box in world space.
box World space bounding box.
radius Radius of the bounding sphere.

Variables


Name Description
clipping_precision Precision qualifier use for clipping.
distance Automatically filled by the clipping system, but can be overridden; this value is the distance between the Bounds center and the Camera used to render it.

GeometryRay


Contains the result returned by the Geometry Raycast function.

Static Variables


Name Description
hit Boolean value that determine if the ray actually hit the Geometry.
hit_point The exact location of the hit.
hit_normal The normal at the hit position.
primitive_index The primitive index where the hit occurs.

Vertex


Vertex properties.

Variables


Name Description
position Tri-dimensional position of the Vertex.
normal Vertex normal.
weight_index The Vertex weight starting position.
weight_count Amount of weight to process after weight_index.
texcoord Texture coordinate layer specify by the layer id.
tangent Tangent for texture layer specified by its id.
color Vertex color specified by its layer id.

Weight


Weight properties.

Variables


Name Description
joint_index The index of the joint that will influence the Vertex.
influence Amount of Weight influence.

PrimitiveData


A primitive is a set specific set of element indices that are delimited by a single Material within the Geometry. The following data structure represents the properties that can be set for each primitive.

Static Variables


Name Description
mode What the primitive is actually drawing; like triangles, points, lines etc...
indice_offset Starting position in the Geometry element_array.
indice_count Number of indices required to draw the primitive.




NRG - API 2022.4.384543 - Fri Nov 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA