Class ModelLOD
Represents single Level Of Detail for the model. Contains a collection of the meshes.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Content/Assets/Model.h
Syntax
public class ModelLOD : public ModelLODBase
Fields
Meshes
The meshes array.
Declaration
public Array<Mesh> Meshes
Field Value
Array<Mesh>
|
Methods
Draw(const RenderContext& renderContext, const Mesh::DrawInfo& info, float lodDitherFactor)
Draws all the meshes from the model LOD.
Declaration
public void Draw(const RenderContext& renderContext, const Mesh::DrawInfo& info, float lodDitherFactor) const
Parameters
RenderContext
renderContext
The rendering context. |
Mesh::DrawInfo
info
The packed drawing info data. |
float
lodDitherFactor
The LOD transition dither factor. |
Returns
void
|
Draw(const RenderContext& renderContext, MaterialBase* material, const Matrix& world, StaticFlags flags=StaticFlags::None, bool receiveDecals=true, DrawPass drawModes=DrawPass::Default, float perInstanceRandom = 0.0f, int8 sortOrder = 0)
Draws the meshes from the model LOD.
Declaration
public void Draw(const RenderContext& renderContext, MaterialBase* material, const Matrix& world, StaticFlags flags=StaticFlags::None, bool receiveDecals=true, DrawPass drawModes=DrawPass::Default, float perInstanceRandom = 0.0f, int8 sortOrder = 0) const
Parameters
RenderContext
renderContext
The rendering context. |
MaterialBase
material
The material to use for rendering. |
Matrix
world
The world transformation of the model. |
StaticFlags
flags
The object static flags. |
bool
receiveDecals
True if rendered geometry can receive decals, otherwise false. |
DrawPass
drawModes
The draw passes to use for rendering this object. |
float
perInstanceRandom
The random per-instance value (normalized to range 0-1). |
int8
sortOrder
Object sorting key. |
Draw(const RenderContextBatch& renderContextBatch, const Mesh::DrawInfo& info, float lodDitherFactor)
Draws all the meshes from the model LOD.
Declaration
public void Draw(const RenderContextBatch& renderContextBatch, const Mesh::DrawInfo& info, float lodDitherFactor) const
Parameters
RenderContextBatch
renderContextBatch
The rendering context batch. |
Mesh::DrawInfo
info
The packed drawing info data. |
float
lodDitherFactor
The LOD transition dither factor. |
Returns
void
|
GetMesh(int32 index)
Gets the specific mesh in this LOD.
Declaration
public virtual MeshBase* GetMesh(int32 index) const override
Parameters
int32
index
|
Returns
MeshBase
|
Overrides
GetMeshes(Array<const MeshBase* >& meshes)
Gets the meshes in this LOD.
Declaration
public virtual void GetMeshes(Array<const MeshBase* >& meshes) const override
Parameters
Array<MeshBase >
meshes
|
Overrides
GetMeshes(Array<MeshBase* >& meshes)
Gets the meshes in this LOD.
Declaration
public virtual void GetMeshes(Array<MeshBase* >& meshes) override
Parameters
Array<MeshBase >
meshes
|
Overrides
GetMeshesCount()
Gets the amount of meshes in this LOD.
Declaration
public virtual int32 GetMeshesCount() const override
Returns
int32
|
Overrides
GetVertexCount()
Gets the vertex count for this model LOD level.
Declaration
public int32 GetVertexCount() const
Returns
int32
|
Intersects(const Ray& ray, const Matrix& world, Real& distance, Vector3& normal, Mesh* *mesh)
Determines if there is an intersection between the Model and a Ray in given world using given instance
Declaration
public bool Intersects(const Ray& ray, const Matrix& world, Real& distance, Vector3& normal, Mesh* *mesh)
Parameters
Ray
ray
The ray to test |
Matrix
world
World to test |
Real
distance
When the method completes, contains the distance of the intersection (if any valid). |
Vector3
normal
When the method completes, contains the intersection surface normal vector (if any valid). |
Mesh
mesh
Mesh, or null |
Returns
bool
True whether the two objects intersected |
Intersects(const Ray& ray, const Transform& transform, Real& distance, Vector3& normal, Mesh* *mesh)
Determines if there is an intersection between the Model and a Ray in given world using given instance
Declaration
public bool Intersects(const Ray& ray, const Transform& transform, Real& distance, Vector3& normal, Mesh* *mesh)
Parameters
Ray
ray
The ray to test |
Transform
transform
The instance transformation. |
Real
distance
When the method completes, contains the distance of the intersection (if any valid). |
Vector3
normal
When the method completes, contains the intersection surface normal vector (if any valid). |
Mesh
mesh
Mesh, or null |
Returns
bool
True whether the two objects intersected |
Render(GPUContext* context)
Draws the meshes. Binds vertex and index buffers and invokes the draw calls.
Declaration
public void Render(GPUContext* context)
Parameters
GPUContext
context
The GPU context to draw with. |
Returns
void
|