class_meshinstance - vkbsb/godot GitHub Wiki
MeshInstance
####Inherits: GeometryInstance ####Category: Core
Brief Description
Node that instances meshes into a [Scenario].
Member Functions
- void set_mesh ( Mesh mesh )
- Mesh get_mesh ( ) const
- void set_skeleton_path ( NodePath skeleton_path )
- NodePath get_skeleton_path ( )
- AABB get_aabb ( ) const
- void create_trimesh_collision ( )
- void create_convex_collision ( )
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
set_mesh
- void set_mesh ( Mesh mesh )
Set the Mesh resource for the instance.
get_mesh
- Mesh get_mesh ( ) const
Return the current Mesh resource for the instance.
get_aabb
- AABB get_aabb ( ) const
Return the AABB of the mesh, in local coordinates.
create_trimesh_collision
- void create_trimesh_collision ( )
This helper creates a StaticBody child Node using the mesh geometry as collision. It"apos;s mainly used for testing.