Table Of Contents

Previous topic

19.7. The RigidBody Object

Next topic

19.9. The TriangleArray Object

This Page

19.8. The Shape Object

A Shape object represents a volume and it is required for creating RigidBody objects and for convex sweep tests.

This is the list of supported volumes:

  • Plane
  • Box
  • Sphere
  • Capsule
  • Cylinder
  • Cone
  • Triangle Mesh
  • Convex Hull

They call all be created with functions on the PhysicsDevice.

19.8.1. Properties

19.8.1.1. margin

Summary

The collision margin to be used with the shape.

Syntax

// Get the current margin
var margin = shape.margin;

// Make it twice bigger
shape.margin = (2.0 * margin);

19.8.1.2. radius

Summary

Radius of the minimum sphere that overlaps the whole shape. This value may not be optimal for triangle meshes or convex hulls.

Syntax

var shapeRadius = shape.radius;

Note

Read Only

19.8.1.3. halfExtents

Summary

A Vector3 object containing the half extents of the shape.

Syntax

var halfExtents = shape.halfExtents;
var width  = (2.0 * halfExtents[0]);
var height = (2.0 * halfExtents[1]);

Note

Read Only

19.8.1.4. inertia

Summary

A Vector3 object containing the local inertia of the shape.

Syntax

var inertia = shape.inertia;

Note

Read Only

19.8.1.5. type

Summary

Name of the shape type.

Syntax

var shapeType = shape.type;

Note

Read Only