RigidShape

consoledoc.h

The RigidShape class implements rigid-body physics for DTS objects in the world.

More...

Public Static Attributes

bool

Disables rendering of all instances of this type.

bool

Disables selection of all instances of this type.

Public Functions

void

Forces the client to jump to the RigidShape's transform rather then warp to it.

void
freezeSim(bool isFrozen)

Enables or disables the physics simulation on the RigidShape object.

void

Clears physic forces from the shape and sets it at rest.

Detailed Description

The RigidShape class implements rigid-body physics for DTS objects in the world.

"Rigid body physics" refers to a system whereby objects are assumed to have a finite size, equally distributed masses, and where deformations of the objects themselves are not accounted for. Uses the RigidShape class to control its physics.

  datablock RigidShapeData( BouncingBoulder )
  {
     category = "RigidShape";

     shapeFile = "~/data/shapes/boulder/boulder.dts";
     emap = true;

     // Rigid Body
     mass = 500;
     massCenter = "0 0 0";    // Center of mass for rigid body
     massBox = "0 0 0";         // Size of box used for moment of inertia,
                         // if zero it defaults to object bounding box
     drag = 0.2;                // Drag coefficient
     bodyFriction = 0.2;
     bodyRestitution = 0.1;
     minImpactSpeed = 5;        // Impacts over this invoke the script callback
     softImpactSpeed = 5;       // Play SoftImpact Sound
     hardImpactSpeed = 15;      // Play HardImpact Sound
     integration = 4;           // Physics integration: TickSec/Rate
     collisionTol = 0.1;        // Collision distance tolerance
     contactTol = 0.1;          // Contact velocity tolerance

     minRollSpeed = 10;

     maxDrag = 0.5;
     minDrag = 0.01;

     dustHeight = 10;

     dragForce = 0.05;
     vertFactor = 0.05;
  };

new RigidShape()
  {
     dataBlock = "BouncingBoulder";
     parentGroup = EWCreatorWindow.objectGroup;
  };

Public Static Attributes

bool isRenderable 

Disables rendering of all instances of this type.

bool isSelectable 

Disables selection of all instances of this type.

Public Functions

forceClientTransform()

Forces the client to jump to the RigidShape's transform rather then warp to it.

freezeSim(bool isFrozen)

Enables or disables the physics simulation on the RigidShape object.

Parameters:

isFrozen

Boolean frozen state to set the object.

// Define the frozen state.
%isFrozen = "true";

// Inform the object of the defined frozen state
%thisRigidShape.freezeSim(%isFrozen);

reset()

Clears physic forces from the shape and sets it at rest.

// Inform the RigidShape object to reset.
%thisRigidShape.reset();