Josh's Graphics Library
|
#include <VertexArray.h>
Public Member Functions | |
VRamList | GetVertices () const |
Don't use these for anything other than drawing because the GPU is gonna spin during read-back. More... | |
VRamList | GetIndices () const |
VRamList | GetNormals () const |
VRamList | GetTextureCoordinates () const |
std::vector< Vertex > | GetLocalVertices () const |
These are for cpu side calculations. More... | |
std::vector< unsigned int > | GetLocalIndices () const |
std::vector< TextureCoordinate > | GetLocalTextureCoordinates () const |
std::vector< Normal > | GetLocalNormals () const |
Sphere | GetMESphere (const Vector3 &scale=Vector3::One, const Vector3 &translate_part=Vector3::Zero) const |
Provides the minimally enclosing bounding sphere of the vertex array given information from the instance. More... | |
Sphere | GetMESphere (const Matrix4x4 &instance_matrix, bool translate=false) const |
Provides the minimally enclosing bounding sphere of the vertex array given information from the instance. More... | |
OBB | GetMEOBB (const Matrix3x3 &rotation_matrix, const Vector3 &scale=Vector3::One, const Vector3 &translate_part=Vector3::Zero) const |
Provides the minimally enclosing oriented bounding box of the vertex array given information from the instance. More... | |
OBB | GetMEOBB (const Matrix4x4 &instance_matrix, bool translate=false) const |
Provides the minimally enclosing oriented bounding box of the vertex array given information from the instance. More... | |
AABB | GetMEAABB (const Matrix3x3 &rotation_matrix, const Vector3 &scale=Vector3::One, const Vector3 &translate_part=Vector3::Zero) const |
Provides the minimally enclosing axis-aligned bounding box of the vertex array given information from the instance. More... | |
AABB | GetMEAABB (const Matrix4x4 &instance_matrix, bool translate=false) const |
VertexArray (const Vector3 *vertex_positions, const long &vp_length, const unsigned int *vertex_indices=nullptr, const long &vi_length=0, const Normal *vertex_normals=nullptr, const long &vn_length=0, const TextureCoordinate *texture_coordinates=nullptr, const long &vt_length=0) | |
Vertices are required, Everything else is optional. More... | |
Protected Member Functions | |
virtual void | CreateMESphere () |
virtual void | CreateMEOBB () |
Protected Attributes | |
VRamList | vertices |
VRamList | indices |
VRamList | normals |
VRamList | texture_coordinates |
std::vector< Vertex > | local_vertices |
Intended for low quality version in system memory for calculations to be done on the CPU. More... | |
std::vector< unsigned int > | local_indices |
std::vector< TextureCoordinate > | local_texture_coordinates |
std::vector< Normal > | local_normals |
VertexArray::VertexArray | ( | const Vector3 * | vertex_positions, |
const long & | vp_length, | ||
const unsigned int * | vertex_indices = nullptr , |
||
const long & | vi_length = 0 , |
||
const Normal * | vertex_normals = nullptr , |
||
const long & | vn_length = 0 , |
||
const TextureCoordinate * | texture_coordinates = nullptr , |
||
const long & | vt_length = 0 |
||
) |
Vertices are required, Everything else is optional.
|
protectedvirtual |
|
protectedvirtual |
VRamList VertexArray::GetIndices | ( | ) | const |
std::vector< unsigned int > VertexArray::GetLocalIndices | ( | ) | const |
std::vector< Normal > VertexArray::GetLocalNormals | ( | ) | const |
std::vector< TextureCoordinate > VertexArray::GetLocalTextureCoordinates | ( | ) | const |
std::vector< Vertex > VertexArray::GetLocalVertices | ( | ) | const |
These are for cpu side calculations.
AABB VertexArray::GetMEAABB | ( | const Matrix3x3 & | rotation_matrix, |
const Vector3 & | scale = Vector3::One , |
||
const Vector3 & | translate_part = Vector3::Zero |
||
) | const |
Provides the minimally enclosing axis-aligned bounding box of the vertex array given information from the instance.
rotation_matrix | A Matrix3x3 representing rotation in 3D space. |
scale | The scale of the instance. |
translate_part | The center of the box would be shifted in 3D space by this. Primarily for world space. |
AABB VertexArray::GetMEAABB | ( | const Matrix4x4 & | instance_matrix, |
bool | translate = false |
||
) | const |
OBB VertexArray::GetMEOBB | ( | const Matrix3x3 & | rotation_matrix, |
const Vector3 & | scale = Vector3::One , |
||
const Vector3 & | translate_part = Vector3::Zero |
||
) | const |
Provides the minimally enclosing oriented bounding box of the vertex array given information from the instance.
rotation_matrix | A Matrix3x3 representing rotation in 3D space. |
scale | The scale of the instance. |
translate_part | The center of the box would be shifted in 3D space by this. Primarily for world space. |
OBB VertexArray::GetMEOBB | ( | const Matrix4x4 & | instance_matrix, |
bool | translate = false |
||
) | const |
Provides the minimally enclosing oriented bounding box of the vertex array given information from the instance.
instance_matrix | A Matrix4x4 which contains scale, rotation, and translation. |
translate | Whether or not to translate to world space by the translate part of the Matrix. |
Sphere VertexArray::GetMESphere | ( | const Matrix4x4 & | instance_matrix, |
bool | translate = false |
||
) | const |
Provides the minimally enclosing bounding sphere of the vertex array given information from the instance.
instance_matrix | A Matrix4x4 which contains scale, rotation, and translation. |
translate | Whether or not to translate to world space by the translate part of the Matrix. |
Sphere VertexArray::GetMESphere | ( | const Vector3 & | scale = Vector3::One , |
const Vector3 & | translate_part = Vector3::Zero |
||
) | const |
Provides the minimally enclosing bounding sphere of the vertex array given information from the instance.
scale | The scale of the instance. |
translate_part | The center of the sphere would be shifted in 3D space by this. Primarily for world space. |
JGL::VRamList VertexArray::GetNormals | ( | ) | const |
VRamList VertexArray::GetTextureCoordinates | ( | ) | const |
VRamList VertexArray::GetVertices | ( | ) | const |
Don't use these for anything other than drawing because the GPU is gonna spin during read-back.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Intended for low quality version in system memory for calculations to be done on the CPU.
In some scenarios like complex collision, You'd have to loop over every vertex. It makes more sense for performance and memory reasons to store a much lower quality version in system memory.
|
protected |
|
protected |
|
protected |