Added cone primitive generation

Lacks normal/tangents/uv


Former-commit-id: 682bb7ea926361bfb10807f6addf98f8fd4e7d75
This commit is contained in:
Lynix
2013-12-09 14:15:34 +01:00
parent b05f813e70
commit a9af5523ee
8 changed files with 134 additions and 2 deletions

View File

@@ -18,6 +18,21 @@ inline void NzPrimitive::MakeBox(const NzVector3f& lengths, const NzVector3ui& s
MakeBox(lengths, subdivision, NzMatrix4f::Transform(position, rotation), uvCoords);
}
inline void NzPrimitive::MakeCone(float length, float radius, unsigned int subdivision, const NzMatrix4f& transformMatrix, const NzRectf& uvCoords)
{
matrix = transformMatrix;
textureCoords = uvCoords;
type = nzPrimitiveType_Cone;
cone.length = length;
cone.radius = radius;
cone.subdivision = subdivision;
}
inline void NzPrimitive::MakeCone(float length, float radius, unsigned int subdivision, const NzVector3f& position, const NzQuaternionf& rotation, const NzRectf& uvCoords)
{
MakeCone(length, radius, subdivision, NzMatrix4f::Transform(position, rotation), uvCoords);
}
inline void NzPrimitive::MakeCubicSphere(float size, unsigned int subdivision, const NzMatrix4f& transformMatrix, const NzRectf& uvCoords)
{
matrix = transformMatrix;
@@ -99,6 +114,22 @@ inline NzPrimitive NzPrimitive::Box(const NzVector3f& lengths, const NzVector3ui
return primitive;
}
inline NzPrimitive NzPrimitive::Cone(float length, float radius, unsigned int subdivision, const NzMatrix4f& transformMatrix, const NzRectf& uvCoords)
{
NzPrimitive primitive;
primitive.MakeCone(length, radius, subdivision, transformMatrix, uvCoords);
return primitive;
}
inline NzPrimitive NzPrimitive::Cone(float length, float radius, unsigned int subdivision, const NzVector3f& position, const NzQuaternionf& rotation, const NzRectf& uvCoords)
{
NzPrimitive primitive;
primitive.MakeCone(length, radius, subdivision, position, rotation, uvCoords);
return primitive;
}
inline NzPrimitive NzPrimitive::CubicSphere(float size, unsigned int subdivision, const NzMatrix4f& transformMatrix, const NzRectf& uvCoords)
{
NzPrimitive primitive;