DIFF

class PhysicsGeomSource

Methods 6

proto external void Destroy()

Destroys geometry

static proto PhysicsGeom CreateBox(vector size)

Creates box geometry

size
Dimensions of the box
PhysicsGeom geom = PhysicsGeom.CreateBox("1 1 1");
static proto PhysicsGeom CreateSphere(float radius)

Creates sphere geometry

radius
Radius of the sphere
PhysicsGeom geom = PhysicsGeom.CreateSphere(0.5);
static proto PhysicsGeom CreateCapsule(float radius, float height)

Creates capsule geometry

radius
Radius of the cylindrical/hemispherical part
height
Height of the cylindrical part
PhysicsGeom geom = PhysicsGeom.CreateCapsule(0.5, 1);
static proto PhysicsGeom CreateCylinder(float radius, float height)

Creates cylinder geometry

radius
Radius of the cylinder
height
Height of the cylinder
PhysicsGeom geom = PhysicsGeom.CreateCylinder(0.5, 1);
static proto PhysicsGeom CreateTriMesh(vector vertices[], int indices[], int numVertices, int numIndices)

Creates tri-mesh geometry

vertices
Set of vertices representing the geometry
indices
Set of indices representing the geometry
numVertices
Number of vertices
numIndices
Number of indices
const int numVerts = 4;
const int numInds = 12;
vector verts[numVerts] = { "0 0 0", "1 0 0", "0 0 1", "0 1 0" };
int inds[numInds] = { 0, 1, 2, 0, 3, 1, 3, 2, 1, 0, 2, 3 };
PhysicsGeom geom = PhysicsGeom.CreateTriMesh(verts, inds, numVerts, numInds);