s&
info
About
info
About s&box
newspaper
Latest News
published_with_changes
Changes
map
Roadmap
monitoring
Metrics
games
Games
sports_esports
Browse Games
explore
Discover Games
category
Workshop
sports_esports
Games
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
construction
More..
forum
Forum
menu_book
Learn
docs
Documentation
api
Api Reference
school
Tutorials
manage_search
Code Search
input
Log in with Steam
chevron_left
Change Language
简体中文
English
Русский
Español
Português-Brasil
Deutsch
日本語
Français
Polski
Türkçe
한국어
Pirate
Italiano
ไทย
繁體中文
Українська
Čeština
Nederlands
Magyar
Dansk
Suomi
Svenska
Norsk
Ελληνικά
Română
Български
Tiếng Việt
Bahasa Indonesia
Español-Latinoamérica
العربية
Api
Classes
ModelBuilder
chevron_left
Classes
class
ModelBuilder
Constructors
functions
ModelBuilder
Methods
functions
AddAnimation
functions
AddAttachment
functions
AddBallJoint
functions
AddBody
functions
AddBone
functions
AddBones
functions
AddCollisionBox
functions
AddCollisionCapsule
functions
AddCollisionHull
functions
AddCollisionMesh
functions
AddCollisionSphere
functions
AddFixedJoint
functions
AddHingeJoint
functions
AddHitboxSet
functions
AddMaterialGroup
functions
AddMesh
functions
AddMeshes
functions
AddSliderJoint
functions
AddSurface
functions
AddTraceMesh
functions
Create
functions
WithEyePosition
functions
WithHullBounds
functions
WithLodDistance
functions
WithMass
functions
WithMaxEyeDeflection
functions
WithName
functions
WithSurface
functions
WithViewBounds
ModelBuilder
Provides the ability to generate Sandbox.Models at runtime. A new instance is available from Sandbox.Model.Builder.
class
Sandbox
.
sealed
Sandbox.Engine
build
Constructors
1
ModelBuilder
(
)
functions
Methods
29
AddAnimation
(
name
,
frameRate
)
AnimationBuilder
Adds an animation to this model and returns a builder to construct the animation. Duplicate names are given a numeric suffix. Animations without frames are omitted from the finished model.
AddAttachment
(
name
,
position
,
rotation
,
parentName
)
ModelBuilder
Adds a named attachment point to the skeleton.
AddBallJoint
(
body1
,
body2
,
frame1
,
frame2
,
collision
)
BallJointBuilder
AddBody
(
mass
,
surface
,
boneName
)
PhysicsBodyBuilder
Adds a physics body to the model. Joints refer to bodies by the order they are added.
AddBone
(
bone
)
Adds a bone to the skeleton.
AddBones
(
bones
)
Adds multiple bones to the skeleton.
AddCollisionBox
(
extents
,
center
,
rotation
)
ModelBuilder
AddCollisionCapsule
(
center0
,
center1
,
radius
)
ModelBuilder
Adds a capsule collision shape.
AddCollisionHull
(
vertices
,
center
,
rotation
)
ModelBuilder
AddCollisionMesh
(
vertices
,
indices
)
ModelBuilder
AddCollisionSphere
(
radius
,
center
)
ModelBuilder
Adds a sphere collision shape.
AddFixedJoint
(
body1
,
body2
,
frame1
,
frame2
,
collision
)
FixedJointBuilder
AddHingeJoint
(
body1
,
body2
,
frame1
,
frame2
,
collision
)
HingeJointBuilder
AddHitboxSet
(
name
)
HitboxSetBuilder
Adds a named hitbox set.
AddMaterialGroup
(
name
)
MaterialGroupBuilder
Adds a named material variant and returns a builder for its materials.
AddMesh
(
mesh
)
ModelBuilder
Adds a mesh that is visible at every LOD level and in every body group.
AddMeshes
(
meshes
)
ModelBuilder
Adds multiple meshes that are visible at every LOD level and in every body group.
AddSliderJoint
(
body1
,
body2
,
frame1
,
frame2
,
collision
)
SliderJointBuilder
AddSurface
(
surface
)
ModelBuilder
Adds a surface that can be referenced by collision mesh material indices.
AddTraceMesh
(
vertices
,
indices
)
ModelBuilder
Create
(
)
Model
Builds the model.
WithEyePosition
(
position
)
ModelBuilder
Sets the model-space position used as the model's eye position.
WithHullBounds
(
bounds
)
ModelBuilder
Sets the bounds used for physics and gameplay queries. If not set, the bounds are calculated from the model's physics data.
WithLodDistance
(
lod
,
distance
)
ModelBuilder
Sets the distance at which an LOD level becomes active. By default, each level switches at
lod * 50
.
WithMass
(
mass
)
ModelBuilder
Sets the mass, in kilograms, used by collision shapes added directly to this builder. The default is 1000.
WithMaxEyeDeflection
(
degrees
)
ModelBuilder
Sets the maximum angle, in degrees, that the model's eyes can turn away from forward.
WithName
(
name
)
ModelBuilder
Sets the name used to identify the model.
WithSurface
(
name
)
ModelBuilder
Sets the surface used by collision shapes added directly to this builder.
WithViewBounds
(
bounds
)
ModelBuilder
Sets the bounds used for rendering and visibility. If not set, the bounds are calculated from the model's meshes.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.