#include <scatterpointsmesh.h>
Public Member Functions | |
ScatterPointsMesh (Core &core) | |
virtual bool | init (utility::ErrorState &errorState) override |
virtual MeshInstance & | getMeshInstance () override |
virtual const MeshInstance & | getMeshInstance () const override |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
ResourcePtr< IMesh > | mReferenceMesh = nullptr |
Property: 'ReferenceMesh' link to the mesh that is used as a reference, can be null (ie: nothing) More... | |
int | mNumberOfPoints = 1000 |
Property: 'PointCount' number of points to scatter on the mesh. More... | |
EMemoryUsage | mUsage = EMemoryUsage::Static |
Property: 'Usage' If the plane is created once or frequently updated. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Protected Types | |
using | TriangleAreaMap = std::map< float, Triangle > |
Protected Member Functions | |
bool | createMeshInstance (nap::utility::ErrorState &error) |
bool | setup (nap::utility::ErrorState &error) |
bool | scatterPoints (nap::utility::ErrorState &error) |
float | computeArea (TriangleAreaMap &outMap) |
Protected Attributes | |
std::unique_ptr< MeshInstance > | mMeshInstance = nullptr |
The actual mesh that contains all the points. More... | |
nap::Vec3VertexAttribute * | mPositionAttr = nullptr |
Position Attribute data. More... | |
nap::Vec3VertexAttribute * | mNormalsAttr = nullptr |
Normal attribute data. More... | |
std::vector< nap::Vec3VertexAttribute * > | mUvAttrs |
UV attribute data. More... | |
std::vector< nap::Vec4VertexAttribute * > | mColorAttrs |
Color attribute data. More... | |
RenderService * | mRenderService = nullptr |
Handle to render service. More... | |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Randomly distributes a certain amount of points over the surface of a mesh The result is a new mesh that does not contain any triangles, only points as vertices The uv, color and normal attributes are copied over from the reference mesh if available!
|
protected |
ScatterPointsMesh | ( | Core & | core | ) |
|
protected |
|
protected |
|
overridevirtual |
Implements IMesh.
|
overridevirtual |
Implements IMesh.
|
overridevirtual |
Initialize this object after de-serialization
errorState | contains the error message when initialization fails |
Reimplemented from Object.
|
protected |
|
protected |
|
protected |
Color attribute data.
|
protected |
The actual mesh that contains all the points.
|
protected |
Normal attribute data.
int mNumberOfPoints = 1000 |
Property: 'PointCount' number of points to scatter on the mesh.
|
protected |
Position Attribute data.
ResourcePtr<IMesh> mReferenceMesh = nullptr |
Property: 'ReferenceMesh' link to the mesh that is used as a reference, can be null (ie: nothing)
|
protected |
Handle to render service.
EMemoryUsage mUsage = EMemoryUsage::Static |
Property: 'Usage' If the plane is created once or frequently updated.
|
protected |
UV attribute data.