3DRadSpace 0.1.0Alpha
3DRadSpace is a free, simple to use, rapid application development game engine.
Loading...
Searching...
No Matches
Engine3DRadSpace.Graphics.Model3D Class Reference

Represents a 3D model, composed of multiple ModelMesh instances. More...

#include <Model3D.hpp>

Inheritance diagram for Engine3DRadSpace.Graphics.Model3D:
Collaboration diagram for Engine3DRadSpace.Graphics.Model3D:

Public Member Functions

 Model3D (IntPtr handle)
 Model3D (IGraphicsDevice device, string path)
void SetShader (Effect effect)
unsafe void SetShaders (Effect[] effects)
 Model3D (IGraphicsDevice *Device, const std::filesystem::path &path)
 Model3D (Model3D &)=delete
 Model3D (Model3D &&) noexcept=default
Model3D & operator= (Model3D &)=delete
Model3D & operator= (Model3D &&) noexcept=default
void SetTransform (const Math::Matrix4x4 &w, const Math::Matrix4x4 &v, const Math::Matrix4x4 &p)
 Sets the world, view, and projection transform matrices for the model.
void SetTransform (const Math::Matrix4x4 &v, const Math::Matrix4x4 &p)
 Sets the view and projection matrices.
ModelMesh * operator[] (unsigned i)
 Gets the i-th ModelMesh in the model. No null checking.
std::vector< std::unique_ptr< ModelMesh > >::iterator begin ()
 Begin iterator for the collection of ModelMesh instances in the model.
std::vector< std::unique_ptr< ModelMesh > >::iterator end ()
 End iterator for the collection of ModelMesh instances in the model.
size_t NumMeshes ()
 Returns the number of ModelMesh instances in this model.
Math::BoundingBox GetBoundingBox () const noexcept
 Gets the bounding box of this entire model instance.
Math::BoundingSphere GetBoundingSphere () const noexcept
 Gets the bounding sphere of this entire model instance.
 ~Model3D ()=default
Public Member Functions inherited from Engine3DRadSpace.NatPtrWrapper
virtual void Dispose ()

Properties

ulong NumMeshes [get]
ModelMesh this[ulong idx] [get]
BoundingBox BoundingBox [get]
BoundingSphere BoundingSphere [get]
unsafe Matrix4x4 Transform [set]
Properties inherited from Engine3DRadSpace.NatPtrWrapper
IntPtr Handle [get]

Additional Inherited Members

Protected Member Functions inherited from Engine3DRadSpace.NatPtrWrapper
 NatPtrWrapper (IntPtr handle, Action< IntPtr > fnDestroy)
 NatPtrWrapper (Action< IntPtr > fnDestroy)
void Reset (IntPtr newObj)
void Dispose (bool disposing)
Protected Attributes inherited from Engine3DRadSpace.NatPtrWrapper
IntPtr _handle
bool _disposed

Detailed Description

Represents a 3D model, composed of multiple ModelMesh instances.

Assimp is used to load the model.

Constructor & Destructor Documentation

◆ Model3D() [1/5]

Engine3DRadSpace.Graphics.Model3D.Model3D ( IntPtr handle)
inline

◆ Model3D() [2/5]

Engine3DRadSpace.Graphics.Model3D.Model3D ( IGraphicsDevice device,
string path )
inline

◆ Model3D() [3/5]

Model3D::Model3D ( IGraphicsDevice * Device,
const std::filesystem::path & path )

◆ Model3D() [4/5]

◆ Model3D() [5/5]

◆ ~Model3D()

Engine3DRadSpace.Graphics.Model3D.~Model3D ( )
default

Member Function Documentation

◆ begin()

std::vector< std::unique_ptr< ModelMesh > >::iterator Model3D::begin ( )

Begin iterator for the collection of ModelMesh instances in the model.

Returns
An iterator to the beginning of the collection of ModelMesh instances.

◆ end()

std::vector< std::unique_ptr< ModelMesh > >::iterator Model3D::end ( )

End iterator for the collection of ModelMesh instances in the model.

Returns
An iterator to the end of the collection of ModelMesh instances.

◆ GetBoundingBox()

BoundingBox Model3D::GetBoundingBox ( ) const
noexcept

Gets the bounding box of this entire model instance.

Returns
The bounding box of this entire model instance.

◆ GetBoundingSphere()

BoundingSphere Model3D::GetBoundingSphere ( ) const
noexcept

Gets the bounding sphere of this entire model instance.

Returns
The bounding sphere of this entire model instance.

◆ NumMeshes()

Returns the number of ModelMesh instances in this model.

Returns

◆ operator=() [1/2]

Model3D & Engine3DRadSpace.Graphics.Model3D.operator= ( Model3D && )
defaultnoexcept

◆ operator=() [2/2]

Model3D & Engine3DRadSpace.Graphics.Model3D.operator= ( Model3D & )
delete

◆ operator[]()

ModelMesh * Model3D::operator[] ( unsigned i)

Gets the i-th ModelMesh in the model. No null checking.

Parameters
iThe index of the ModelMesh to retrieve.
Returns
The i-th ModelMesh.

◆ SetShader()

void Engine3DRadSpace.Graphics.Model3D.SetShader ( Effect effect)
inline

◆ SetShaders()

unsafe void Engine3DRadSpace.Graphics.Model3D.SetShaders ( Effect[] effects)
inline

◆ SetTransform() [1/2]

void Engine3DRadSpace.Graphics.Model3D.SetTransform ( const Math::Matrix4x4 & v,
const Math::Matrix4x4 & p )

Sets the view and projection matrices.

Parameters
vView matrix
pProjection matrix

◆ SetTransform() [2/2]

void Engine3DRadSpace.Graphics.Model3D.SetTransform ( const Math::Matrix4x4 & w,
const Math::Matrix4x4 & v,
const Math::Matrix4x4 & p )

Sets the world, view, and projection transform matrices for the model.

Parameters
wThe world matrix.
vThe view matrix.
pThe projection matrix.

Property Documentation

◆ BoundingBox

BoundingBox Engine3DRadSpace.Graphics.Model3D.BoundingBox
get

◆ BoundingSphere

BoundingSphere Engine3DRadSpace.Graphics.Model3D.BoundingSphere
get

◆ NumMeshes

size_t Model3D.NumMeshes
get

◆ this[ulong idx]

ModelMesh Engine3DRadSpace.Graphics.Model3D.this[ulong idx]
get

◆ Transform

unsafe Matrix4x4 Engine3DRadSpace.Graphics.Model3D.Transform
set

The documentation for this class was generated from the following files: