C# Class Project290.Physics.Collision.Shapes.EdgeShape

A line segment (edge) Shape. These can be connected in chains or loops to other edge Shapes. The connectivity information is used to ensure correct contact normals.
Inheritance: Shape
ファイルを表示 Open project: scastle/Solitude Class Usage Examples

Public Properties

Property Type Description
HasVertex0 bool
Vertex0 Microsoft.Xna.Framework.Vector2
Vertex1 Microsoft.Xna.Framework.Vector2
Vertex3 Microsoft.Xna.Framework.Vector2

Public Methods

Method Description
Clone ( ) : Shape
ComputeAABB ( AABB &aabb, Transform &transform, int childIndex ) : void

Given a transform, compute the associated axis aligned bounding box for a child shape.

ComputeProperties ( ) : 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.

EdgeShape ( Vector2 start, Vector2 end ) : Microsoft.Xna.Framework
RayCast ( RayCastOutput &output, RayCastInput &input, Transform &transform, int childIndex ) : bool

Cast a ray against a child shape.

Set ( Vector2 start, Vector2 end ) : void

Set this as an isolated edge.

TestPoint ( Transform &transform, Vector2 &point ) : bool

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

Private Methods

Method Description
EdgeShape ( ) : Microsoft.Xna.Framework

Method Details

Clone() public method

public Clone ( ) : Shape
return Shape

ComputeAABB() public method

Given a transform, compute the associated axis aligned bounding box for a child shape.
public ComputeAABB ( AABB &aabb, Transform &transform, int childIndex ) : void
aabb AABB The aabb results.
transform Transform The world transform of the shape.
childIndex int The child shape index.
return void

ComputeProperties() 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 ComputeProperties ( ) : void
return void

EdgeShape() public method

public EdgeShape ( Vector2 start, Vector2 end ) : Microsoft.Xna.Framework
start Microsoft.Xna.Framework.Vector2
end Microsoft.Xna.Framework.Vector2
return Microsoft.Xna.Framework

RayCast() public method

Cast a ray against a child shape.
public RayCast ( RayCastOutput &output, RayCastInput &input, Transform &transform, int childIndex ) : bool
output RayCastOutput The ray-cast results.
input RayCastInput The ray-cast input parameters.
transform Transform The transform to be applied to the shape.
childIndex int The child shape index.
return bool

Set() public method

Set this as an isolated edge.
public Set ( Vector2 start, Vector2 end ) : void
start Microsoft.Xna.Framework.Vector2 The start.
end Microsoft.Xna.Framework.Vector2 The end.
return void

TestPoint() public method

Test a point for containment in this shape. This only works for convex shapes.
public TestPoint ( Transform &transform, Vector2 &point ) : bool
transform Transform The shape world transform.
point Microsoft.Xna.Framework.Vector2 a point in world coordinates.
return bool

Property Details

HasVertex0 public_oe property

public bool HasVertex0
return bool

Vertex0 public_oe property

Optional adjacent vertices. These are used for smooth collision.
public Vector2,Microsoft.Xna.Framework Vertex0
return Microsoft.Xna.Framework.Vector2

Vertex1 public_oe property

These are the edge vertices
public Vector2,Microsoft.Xna.Framework Vertex1
return Microsoft.Xna.Framework.Vector2

Vertex3 public_oe property

Optional adjacent vertices. These are used for smooth collision.
public Vector2,Microsoft.Xna.Framework Vertex3
return Microsoft.Xna.Framework.Vector2