C# Class Box2DX.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.
Mostrar archivo Open project: KrugerHeavyIndustries/box2d-unity Class Usage Examples

Public Properties

Property Type Description
Density float
Filter FilterData
Friction float
Restitution float
UserData object

Protected Properties

Property Type Description
_isSensor bool
_proxyId System.UInt16
_shape Box2DX.Collision.Shape
_type ShapeType

Public Methods

Method Description
ComputeMass ( MassData &massData ) : void

Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin, not the centroid.

ComputeSubmergedArea ( Vector2 normal, float offset, Vector2 &c ) : float

Compute the volume and centroid of this fixture intersected with a half plane.

ComputeSweepRadius ( Vector2 pivot ) : float

Get the maximum radius about the parent body's center of mass.

Create ( BroadPhase broadPhase, Body body, Box2DX.Common.Transform xf, FixtureDef def ) : void
Destroy ( BroadPhase broadPhase ) : void
Dispose ( ) : void
Fixture ( ) : System
TestPoint ( Vector2 p ) : bool

Test a point for containment in this fixture. This only works for convex shapes.

TestSegment ( float &lambda, Vector2 &normal, Segment segment, float maxLambda ) : SegmentCollide

Perform a ray cast against this shape.

Private Methods

Method Description
RefilterProxy ( BroadPhase broadPhase, Box2DX.Common.Transform Transform ) : void
Synchronize ( BroadPhase broadPhase, Box2DX.Common.Transform Transform1, Box2DX.Common.Transform Transform2 ) : bool

Method Details

ComputeMass() public method

Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin, not the centroid.
public ComputeMass ( MassData &massData ) : void
massData Box2DX.Collision.MassData Returns the mass data for this shape.
return void

ComputeSubmergedArea() public method

Compute the volume and centroid of this fixture intersected with a half plane.
public ComputeSubmergedArea ( Vector2 normal, float offset, Vector2 &c ) : float
normal Vector2 Normal the surface normal.
offset float Offset the surface offset along normal.
c Vector2 Returns the centroid.
return float

ComputeSweepRadius() public method

Get the maximum radius about the parent body's center of mass.
public ComputeSweepRadius ( Vector2 pivot ) : float
pivot Vector2
return float

Create() public method

public Create ( BroadPhase broadPhase, Body body, Box2DX.Common.Transform xf, FixtureDef def ) : void
broadPhase Box2DX.Collision.BroadPhase
body Body
xf Box2DX.Common.Transform
def FixtureDef
return void

Destroy() public method

public Destroy ( BroadPhase broadPhase ) : void
broadPhase Box2DX.Collision.BroadPhase
return void

Dispose() public method

public Dispose ( ) : void
return void

Fixture() public method

public Fixture ( ) : System
return System

TestPoint() public method

Test a point for containment in this fixture. This only works for convex shapes.
public TestPoint ( Vector2 p ) : bool
p Vector2 A point in world coordinates.
return bool

TestSegment() public method

Perform a ray cast against this shape.
public TestSegment ( float &lambda, Vector2 &normal, Segment segment, float maxLambda ) : SegmentCollide
lambda float Returns the hit fraction. You can use this to compute the contact point /// p = (1 - lambda) * segment.p1 + lambda * segment.p2.
normal Vector2 Returns the normal at the contact point. If there is no intersection, the normal /// is not set.
segment Box2DX.Collision.Segment Defines the begin and end point of the ray cast.
maxLambda float A number typically in the range [0,1].
return SegmentCollide

Property Details

Density public_oe property

Density, usually in kg/m^2.
public float Density
return float

Filter public_oe property

Contact filtering data. You must call b2World::Refilter to correct existing contacts/non-contacts.
public FilterData Filter
return FilterData

Friction public_oe property

Friction coefficient, usually in the range [0,1].
public float Friction
return float

Restitution public_oe property

Restitution (elasticity) usually in the range [0,1].
public float Restitution
return float

UserData public_oe property

User data that was assigned in the fixture definition. Use this to store your application specific data.
public object UserData
return object

_isSensor protected_oe property

protected bool _isSensor
return bool

_proxyId protected_oe property

protected UInt16,System _proxyId
return System.UInt16

_shape protected_oe property

protected Shape,Box2DX.Collision _shape
return Box2DX.Collision.Shape

_type protected_oe property

protected ShapeType _type
return ShapeType