Skip to content

class_meshinstance

reduz edited this page May 24, 2014 · 10 revisions

MeshInstance

####Inherits: GeometryInstance ####Category: Core

Brief Description

Node that instances meshes into a [Scenario].

Member Functions

Description

MeshInstance is a Node that takes a Mesh resource and adds it to the current [Scenario] by creating an instance of it. This is the class most often used to get 3D geometry rendered and can be used to instance a sigle Mesh in many places. This allows to reuse geometry and save on resources. When a Mesh has to be instanced more than thousands of times at close proximity, consider using a MultiMesh in a MultiMeshInstance instead.

Member Function Description

  • void set_mesh ( Mesh mesh )

Set the Mesh resource for the instance.

  • Mesh get_mesh ( ) const

Return the current Mesh resource for the instance.

  • AABB get_aabb ( ) const

Return the AABB of the mesh, in local coordinates.

  • void create_trimesh_collision ( )

This helper creates a StaticBody child Node using the mesh geometry as collision. It"apos;s mainly used for testing.

Clone this wiki locally