C# Class Jitter.Collision.Shapes.CompoundShape

A Shape representing a compoundShape consisting of several 'sub' shapes.
Inheritance: Jitter.Collision.Shapes.Multishape
显示文件 Open project: tpb3d/TPB3D Class Usage Examples

Public Methods

Method Description
CalculateMassInertia ( ) : void
CompoundShape ( List shapes ) : System

Created a new instance of the CompountShape class.

CompoundShape ( TransformedShape shapes ) : System
GetBoundingBox ( Jitter.LinearMath.JMatrix &orientation, Jitter.LinearMath.JBBox &box ) : void

Gets the axis aligned bounding box of the orientated shape. (Inlcuding all 'sub' shapes)

MakeHull ( List &triangleList, int generationThreshold ) : void
Prepare ( Jitter.LinearMath.JBBox &box ) : int

Passes a axis aligned bounding box to the shape where collision could occour.

Prepare ( Jitter.LinearMath.JVector &rayOrigin, Jitter.LinearMath.JVector &rayEnd ) : int

SetCurrentShape ( int index ) : void

Sets the current shape. First CompoundShape.Prepare has to be called. After SetCurrentShape the shape immitates another shape.

SupportMapping ( Jitter.LinearMath.JVector &direction, Jitter.LinearMath.JVector &result ) : void

SupportMapping. Finds the point in the shape furthest away from the given direction. Imagine a plane with a normal in the search direction. Now move the plane along the normal until the plane does not intersect the shape. The last intersection point is the result.

UpdateShape ( ) : void

Protected Methods

Method Description
CreateWorkingClone ( ) : Jitter.Collision.Shapes.Multishape
UpdateInternalBoundingBox ( ) : void

Private Methods

Method Description
CompoundShape ( ) : System
DoShifting ( ) : void

Translate all subshapes in the way that the center of mass is in (0,0,0)

TestValidity ( ) : bool

Method Details

CalculateMassInertia() public method

public CalculateMassInertia ( ) : void
return void

CompoundShape() public method

Created a new instance of the CompountShape class.
public CompoundShape ( List shapes ) : System
shapes List The 'sub' shapes which should be added to this /// class.
return System

CompoundShape() public method

public CompoundShape ( TransformedShape shapes ) : System
shapes TransformedShape
return System

CreateWorkingClone() protected method

protected CreateWorkingClone ( ) : Jitter.Collision.Shapes.Multishape
return Jitter.Collision.Shapes.Multishape

GetBoundingBox() public method

Gets the axis aligned bounding box of the orientated shape. (Inlcuding all 'sub' shapes)
public GetBoundingBox ( Jitter.LinearMath.JMatrix &orientation, Jitter.LinearMath.JBBox &box ) : void
orientation Jitter.LinearMath.JMatrix The orientation of the shape.
box Jitter.LinearMath.JBBox The axis aligned bounding box of the shape.
return void

MakeHull() public method

public MakeHull ( List &triangleList, int generationThreshold ) : void
triangleList List
generationThreshold int
return void

Prepare() public method

Passes a axis aligned bounding box to the shape where collision could occour.
public Prepare ( Jitter.LinearMath.JBBox &box ) : int
box Jitter.LinearMath.JBBox The bounding box where collision could occur.
return int

Prepare() public method

public Prepare ( Jitter.LinearMath.JVector &rayOrigin, Jitter.LinearMath.JVector &rayEnd ) : int
rayOrigin Jitter.LinearMath.JVector
rayEnd Jitter.LinearMath.JVector
return int

SetCurrentShape() public method

Sets the current shape. First CompoundShape.Prepare has to be called. After SetCurrentShape the shape immitates another shape.
public SetCurrentShape ( int index ) : void
index int
return void

SupportMapping() public method

SupportMapping. Finds the point in the shape furthest away from the given direction. Imagine a plane with a normal in the search direction. Now move the plane along the normal until the plane does not intersect the shape. The last intersection point is the result.
public SupportMapping ( Jitter.LinearMath.JVector &direction, Jitter.LinearMath.JVector &result ) : void
direction Jitter.LinearMath.JVector The direction.
result Jitter.LinearMath.JVector The result.
return void

UpdateInternalBoundingBox() protected method

protected UpdateInternalBoundingBox ( ) : void
return void

UpdateShape() public method

public UpdateShape ( ) : void
return void