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.
Afficher le fichier Open project: KrugerHeavyIndustries/box2d-unity Class Usage Examples

Méthodes publiques

Свойство Type Description
Density float
Filter FilterData
Friction float
Restitution float
UserData object

Protected Properties

Свойство Type Description
_isSensor bool
_proxyId System.UInt16
_shape Box2DX.Collision.Shape
_type ShapeType

Méthodes publiques

Méthode 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

Méthode 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 méthode

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.
Résultat void

ComputeSubmergedArea() public méthode

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.
Résultat float

ComputeSweepRadius() public méthode

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

Create() public méthode

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
Résultat void

Destroy() public méthode

public Destroy ( BroadPhase broadPhase ) : void
broadPhase Box2DX.Collision.BroadPhase
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Fixture() public méthode

public Fixture ( ) : System
Résultat System

TestPoint() public méthode

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.
Résultat bool

TestSegment() public méthode

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].
Résultat SegmentCollide

Property Details

Density public_oe property

Density, usually in kg/m^2.
public float Density
Résultat float

Filter public_oe property

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

Friction public_oe property

Friction coefficient, usually in the range [0,1].
public float Friction
Résultat float

Restitution public_oe property

Restitution (elasticity) usually in the range [0,1].
public float Restitution
Résultat 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
Résultat object

_isSensor protected_oe property

protected bool _isSensor
Résultat bool

_proxyId protected_oe property

protected UInt16,System _proxyId
Résultat System.UInt16

_shape protected_oe property

protected Shape,Box2DX.Collision _shape
Résultat Box2DX.Collision.Shape

_type protected_oe property

protected ShapeType _type
Résultat ShapeType