class ModelBuilder

in global :: Sandbox

Provides ability to generate s at runtime. A static instance of this class is available at


public AnimationBuilder AddAnimation( string name, float frameRate )

Adds an animation to this model and returns a builder to construct the animation.

  • name The name of the animation.
  • frameRate The frames per second of the animation.
  • Returns An instance to construct the animation.

public ModelBuilder WithMass( float mass )

Total mass of the physics body (Default is 1000)

public ModelBuilder WithSurface( string name )

Surface property to use for collision

public ModelBuilder WithLodDistance( int lod, float distance )

LOD switch distance increment for each Level of Detail (LOD) level. (Default is 50)

public ModelBuilder AddCollisionSphere( float radius, Vector3 center = null )

Add sphere collision shape.

public ModelBuilder AddCollisionCapsule( Vector3 center0, Vector3 center1, float radius )

Add capsule collision shape.

public ModelBuilder AddMesh( Mesh mesh )

Add a mesh.

public ModelBuilder AddMeshes( Mesh[] meshes )

Add a bunch of meshes.

public ModelBuilder AddMesh( Mesh mesh, int lod )

Add a mesh to a Level of Detail (LOD) group.

public ModelBuilder AddMeshes( Mesh[] meshes, int lod )

Add a bunch of meshes to a Level of Detail (LOD) group.

public void AddBone( ModelBuilder.Bone bone )

Add a bone to the skeleton via a struct.

public void AddBones( ModelBuilder.Bone[] bones )

Add multiple bones to the skeleton.

public ModelBuilder AddBone( string name, Vector3 position, Rotation rotation, string parentName = null )

Add a bone to the skeleton.

public ModelBuilder WithName( string name )

Provide a name to identify the model by

  • name Desired model name

public bool Equals( object obj )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public Model Create( )

😔 No documentation found.

public ModelBuilder( )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public ModelBuilder AddTraceMesh( Span<Vector3> vertices, Span<int> indices )

😔 No documentation found.

public ModelBuilder AddTraceMesh( List<Vector3> vertices, List<int> indices )

😔 No documentation found.

public ModelBuilder AddCollisionMesh( Span<Vector3> vertices, Span<int> indices )

😔 No documentation found.

public ModelBuilder AddCollisionMesh( List<Vector3> vertices, List<int> indices )

😔 No documentation found.

public ModelBuilder AddCollisionHull( Span<Vector3> vertices, Nullable<Vector3> center = null, Nullable<Rotation> rotation = null )

😔 No documentation found.

public ModelBuilder AddCollisionBox( Vector3 extents, Nullable<Vector3> center = null, Nullable<Rotation> rotation = null )

😔 No documentation found.

public ModelBuilder AddCollisionHull( List<Vector3> vertices, Nullable<Vector3> center = null, Nullable<Rotation> rotation = null )

😔 No documentation found.