s&
About
The Project
info
About s&box
map
Roadmap
monitoring
Metrics
Engine startup and usage numbers
Updates
newspaper
Latest News
published_with_changes
Changes
Release-by-release changelog
Games
Browse Games
Discover Games
gamejams
results
Game Jam III
Crowned
Sat 3 Oct
Winner
🏆 GAMMA ☢ TEAM
Theme
One More Round
This jam is over. The next one will show up here.
See the results
Workshop
Playable
sports_esports
Games
Standalone games and gamemodes
Assets
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
apps
Everything
Every asset type in one list
Forum
Learn
Documentation
rocket_launch
Getting Started
docs
Documentation
api
API Reference
Resources
school
Tutorials
manage_search
Code Search
Get s&box
Sign in with Steam
Api
Classes
Mesh
chevron_left
Classes
class
Mesh
Constructors
functions
Mesh
Properties
data_object
Bounds
data_object
HasIndexBuffer
data_object
HasVertexBuffer
data_object
IndexCount
data_object
IsValid
data_object
Material
data_object
PrimitiveType
data_object
UvDensity
data_object
VertexCount
Methods
functions
AddMorph
functions
AddSubMesh
functions
CreateBuffers
functions
CreateIndexBuffer
functions
CreateVertexBuffer
lock
Finalize
functions
LockIndexBuffer
functions
LockVertexBuffer
functions
SetIndexBufferData
functions
SetIndexBufferSize
functions
SetIndexRange
functions
SetVertexBufferData
functions
SetVertexBufferSize
functions
SetVertexRange
Static Methods
functions
TriangulatePolygon
Mesh
A mesh is a basic version of a Sandbox.Model, containing a set of vertices and indices which make up faces that make up a shape. <para>A set of meshes can be used to create a Sandbox.Model via the Sandbox.ModelBuilder class.</para>
class
Sandbox
.
Sandbox.Engine
build
Constructors
1
Mesh
(
)
data_object
Properties
9
Bounds
BBox
Sets AABB bounds for this mesh.
HasIndexBuffer
bool
Whether this mesh has an index buffer.
HasVertexBuffer
bool
Whether this mesh has a vertex buffer.
IndexCount
int
Number of indices this mesh has.
IsValid
bool
Material
Material
Sets material for this mesh.
PrimitiveType
MeshPrimitiveType
Sets the primitive type for this mesh.
UvDensity
float
Used to calculate texture size for texture streaming.
VertexCount
int
Number of vertices this mesh has.
functions
Methods
14
AddMorph
(
name
,
deltas
)
Mesh
AddSubMesh
(
material
,
startIndex
,
indexCount
,
startVertex
,
vertexCount
)
Mesh
Add a sub mesh, drawing a range of the index buffer with its own
. Create the vertex and index buffers before adding sub meshes.
CreateBuffers
(
vb
,
calculateBounds
)
Create vertex and index buffers.
CreateIndexBuffer
(
)
Create an empty index buffer, it can be resized later
CreateVertexBuffer
(
vertexCount
,
data
)
Finalize
(
)
LockIndexBuffer
(
handler
)
Lock all the memory in this buffer so you can write to it
LockVertexBuffer
(
handler
)
SetIndexBufferData
(
data
,
elementOffset
)
SetIndexBufferSize
(
elementCount
)
Resize the index buffer.
SetIndexRange
(
start
,
count
)
Set how many indices this mesh draws
SetVertexBufferData
(
data
,
elementOffset
)
SetVertexBufferSize
(
elementCount
)
Resize the vertex buffer
SetVertexRange
(
start
,
count
)
Set how many vertices this mesh draws (if there's no index buffer)
functions
Static Methods
1
TriangulatePolygon
(
vertices
)
Span`1
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.