MushMesh

Description

This object contains a 4D mesh definition, including vertices, faces, facets, together with objects which define how the mesh is generated.

Example

mesh = MushMesh.new('mymesh')
mesh.mAddBase(MushBasePrism.new( ... ))
mesh.mAddBaseDisplacement(MushDisplacement.new( ... ))
mesh.mAddExtruder(MushExtruder.new( ... ))
mesh.mAddExtruder(MushExtruder.new( ... ))
mesh.mAddMaterial('material1')
mesh.mMake
Summary
This object contains a 4D mesh definition, including vertices, faces, facets, together with objects which define how the mesh is generated.
Creates a new, empty mesh object.
Creates the mesh, based on the base and extruders, etc.
Adds a MushBase object to the mesh.
Adds a MushDisplacement object to the mesh.
Adds a MushExtruder object to the mesh.
Adds a MushMaterial reference to the mesh.
Sets the billboard flag for the mesh.

new

Creates a new, empty mesh object.

Parameters

Mesh name.

Returns

New MushMesh object.

Default

The default constructor creates an empty mesh.

mMake

Creates the mesh, based on the base and extruders, etc. added.  Must be called before the mesh can be used.

Parameters

None

mAddBase

Adds a MushBase object to the mesh.  This is used as the base object.  Typically the base object is simple and its faces are extruded to produce a more complex mesh.

Parameters

objectSubclass of MushBase

mAddBaseDisplacement

Adds a MushDisplacement object to the mesh.  This is applied to the base object to position and scale it.

Parameters

objectMushDisplacement

mAddExtruder

Adds a MushExtruder object to the mesh.  Extrusions will be applied in the order in which they are added.

Parameters

objectMushExtruder

mAddMaterial

Adds a MushMaterial reference to the mesh.  Materials define the material (textures, lighting, etc) to be used when the mesh is rendered.

Parameters

nameName of the material to be added, previously created using MushMaterial.cDefine

mBillboardSet

Sets the billboard flag for the mesh.  If true, the mesh will always be rendered with the xy plane facing the camera.

Parameters

billboardtrue or false

Links

This object specifies an extrusion.
This object describes the material used to render a mesh.
Base class for mesh base objects.
This object contains an offset vector, a rotation and a scale vector.
Defines a material, adding it to the global database.