C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Density float
Filter FilterData
Friction float
Restitution float
UserData object

Защищенные свойства (Protected)

Свойство Тип Описание
_isSensor bool
_proxyId System.UInt16
_shape Box2DX.Collision.Shape
_type ShapeType

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
RefilterProxy ( BroadPhase broadPhase, Box2DX.Common.Transform Transform ) : void
Synchronize ( BroadPhase broadPhase, Box2DX.Common.Transform Transform1, Box2DX.Common.Transform Transform2 ) : bool

Описание методов

ComputeMass() публичный Метод

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.
Результат void

ComputeSubmergedArea() публичный Метод

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.
Результат float

ComputeSweepRadius() публичный Метод

Get the maximum radius about the parent body's center of mass.
public ComputeSweepRadius ( Vector2 pivot ) : float
pivot Vector2
Результат float

Create() публичный Метод

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
Результат void

Destroy() публичный Метод

public Destroy ( BroadPhase broadPhase ) : void
broadPhase Box2DX.Collision.BroadPhase
Результат void

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Fixture() публичный Метод

public Fixture ( ) : System
Результат System

TestPoint() публичный Метод

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.
Результат bool

TestSegment() публичный Метод

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].
Результат SegmentCollide

Описание свойств

Density публичное свойство

Density, usually in kg/m^2.
public float Density
Результат float

Filter публичное свойство

Contact filtering data. You must call b2World::Refilter to correct existing contacts/non-contacts.
public FilterData Filter
Результат FilterData

Friction публичное свойство

Friction coefficient, usually in the range [0,1].
public float Friction
Результат float

Restitution публичное свойство

Restitution (elasticity) usually in the range [0,1].
public float Restitution
Результат float

UserData публичное свойство

User data that was assigned in the fixture definition. Use this to store your application specific data.
public object UserData
Результат object

_isSensor защищенное свойство

protected bool _isSensor
Результат bool

_proxyId защищенное свойство

protected UInt16,System _proxyId
Результат System.UInt16

_shape защищенное свойство

protected Shape,Box2DX.Collision _shape
Результат Box2DX.Collision.Shape

_type защищенное свойство

protected ShapeType _type
Результат ShapeType