C# Class Project290.Physics.Dynamics.Fixture

A fixture is used to attach a Shape to a body for collision detection. A fixture inherits its transform from its parent. Fixtures hold additional non-geometric data such as friction, collision filters, etc. Fixtures are created via Body.CreateFixture. Warning: You cannot reuse fixtures.
Inheritance: IDisposable
显示文件 Open project: scastle/Solitude Class Usage Examples

Public Properties

Property Type Description
AfterCollision AfterCollisionEventHandler
BeforeCollision BeforeCollisionEventHandler
OnCollision OnCollisionEventHandler
OnSeparation OnSeparationEventHandler
Proxies Project290.Physics.Dynamics.FixtureProxy[]
ProxyCount int

Public Methods

Method Description
Dispose ( ) : void
Fixture ( Body body, Shape shape ) : System
Fixture ( Body body, Shape shape, Object userData ) : System
GetAABB ( AABB &aabb, int childIndex ) : void

Get the fixture's AABB. This AABB may be enlarge and/or stale. If you need a more accurate AABB, compute it using the Shape and the body transform.

GetMassData ( ) : MassData

Get the mass data for this fixture. The mass data is based on the density and the Shape. The rotational inertia is about the Shape's origin.

RayCast ( RayCastOutput &output, RayCastInput &input, int childIndex ) : bool

Cast a ray against this Shape.

TestPoint ( Vector2 &point ) : bool

Test a point for containment in this fixture.

Private Methods

Method Description
CreateProxies ( BroadPhase broadPhase, Transform &xf ) : void
Destroy ( ) : void
DestroyProxies ( BroadPhase broadPhase ) : void
Synchronize ( BroadPhase broadPhase, Transform &transform1, Transform &transform2 ) : void

Method Details

Dispose() public method

public Dispose ( ) : void
return void

Fixture() public method

public Fixture ( Body body, Shape shape ) : System
body Body
shape Project290.Physics.Collision.Shapes.Shape
return System

Fixture() public method

public Fixture ( Body body, Shape shape, Object userData ) : System
body Body
shape Project290.Physics.Collision.Shapes.Shape
userData Object
return System

GetAABB() public method

Get the fixture's AABB. This AABB may be enlarge and/or stale. If you need a more accurate AABB, compute it using the Shape and the body transform.
public GetAABB ( AABB &aabb, int childIndex ) : void
aabb Project290.Physics.Collision.AABB The aabb.
childIndex int Index of the child.
return void

GetMassData() public method

Get the mass data for this fixture. The mass data is based on the density and the Shape. The rotational inertia is about the Shape's origin.
public GetMassData ( ) : MassData
return Project290.Physics.Collision.Shapes.MassData

RayCast() public method

Cast a ray against this Shape.
public RayCast ( RayCastOutput &output, RayCastInput &input, int childIndex ) : bool
output Project290.Physics.Collision.RayCastOutput The ray-cast results.
input Project290.Physics.Collision.RayCastInput The ray-cast input parameters.
childIndex int Index of the child.
return bool

TestPoint() public method

Test a point for containment in this fixture.
public TestPoint ( Vector2 &point ) : bool
point Vector2 A point in world coordinates.
return bool

Property Details

AfterCollision public_oe property

Fires after two shapes has collided and are solved. This gives you a chance to get the impact force.
public AfterCollisionEventHandler AfterCollision
return AfterCollisionEventHandler

BeforeCollision public_oe property

Fires when two fixtures are close to each other. Due to how the broadphase works, this can be quite inaccurate as shapes are approximated using AABBs.
public BeforeCollisionEventHandler BeforeCollision
return BeforeCollisionEventHandler

OnCollision public_oe property

Fires when two shapes collide and a contact is created between them. Note that the first fixture argument is always the fixture that the delegate is subscribed to.
public OnCollisionEventHandler OnCollision
return OnCollisionEventHandler

OnSeparation public_oe property

Fires when two shapes separate and a contact is removed between them. Note that the first fixture argument is always the fixture that the delegate is subscribed to.
public OnSeparationEventHandler OnSeparation
return OnSeparationEventHandler

Proxies public_oe property

public FixtureProxy[],Project290.Physics.Dynamics Proxies
return Project290.Physics.Dynamics.FixtureProxy[]

ProxyCount public_oe property

public int ProxyCount
return int