Skip to main content
Version: 0.12.0 (latest)

UeMesh

The UeMesh class is a renderable object in Unique Engine. It combines a geometry (vertex buffer) with a material and is placed in the scene graph via its transformation.

Constructor​

new UeMesh(geometry, material = global.UE_DEFAULT_MATERIAL, data = {})

Inherits from UeObject3D

Data parameters​

KeyTypeDefaultDescription
primitivenumberpr_trianglelistGPU primitive mode

Properties​

PropertyTypeDefaultDescription
isMeshbooleantrueIdentifies this object as a mesh
typestring"Mesh"Object type
geometryUeGeometryrequiredThe geometry (vertex data)
materialUeMaterialUeMeshStandardMaterial()The material to use
primitivenumberpr_trianglelistGPU primitive mode
skeletonUeSkeletonundefinedThe skeleton associated with this mesh for skinning
bindModestring"attached"Bind mode: "attached" or "skinned"
bindMatrixarrayidentityMatrix of the mesh at the time of binding
bindMatrixInversearrayidentityInverse of the bind matrix
namestring""Object name (empty string by default)

Methods​

MethodReturnsDescription
createInstance()UeMeshCreates a new instance of this mesh that shares the same geometry and material references
raycast(raycaster, intersects)selfTests the ray from raycaster against this object's bounding box and appends hits to intersects. The bounding sphere is checked first for optimization purposes
toJSON()structReturns an object representing this entity's properties. Not all props may be included