Added cone primitive generation
Lacks normal/tangents/uv Former-commit-id: 682bb7ea926361bfb10807f6addf98f8fd4e7d75
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user