HughPH.Box2D
Organised dotnet bindings for Box2D 3.1.0
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
Box2D.ChainDef Class Referencesealed

Used to create a chain of line segments. This is designed to eliminate ghost collisions with some limitations. More...

Public Member Functions

 ChainDef ()
 Creates a chain definition with the default values.
 
unsafe ChainDef (ReadOnlySpan< Vec2 > points, bool autoGenerateGhostVertices=false)
 Creates a chain definition with the supplied points.
 

Properties

object? UserData [get, set]
 Use this to store application specific shape data.
 
unsafe ReadOnlySpan< Vec2 > Points [get, set]
 An array of at least 4 points. These are cloned and may be temporary.
 
unsafe ReadOnlySpan< SurfaceMaterialMaterials [get, set]
 Surface materials for each segment. These are cloned.
 
ref Filter Filter [get]
 Contact filtering data.
 
bool IsLoop [get, set]
 Indicates a closed chain formed by connecting the first and last points.
 
bool EnableSensorEvents [get, set]
 Enable sensors to detect this chain. False by default.
 

Detailed Description

Used to create a chain of line segments. This is designed to eliminate ghost collisions with some limitations.

https://en.wikipedia.org/wiki/Polygonal_chain
Warning: Do not use chain shapes unless you understand the limitations. This is an advanced feature.

Constructor & Destructor Documentation

◆ ChainDef()

unsafe Box2D.ChainDef.ChainDef ( ReadOnlySpan< Vec2 >  points,
bool  autoGenerateGhostVertices = false 
)
inline

Creates a chain definition with the supplied points.

Parameters
pointsThe points to create the chain from
autoGenerateGhostVerticesIf true, additional first and last points will be generated automatically. Has no effect when IsLoop is true.

Property Documentation

◆ Points

unsafe ReadOnlySpan<Vec2> Box2D.ChainDef.Points
getset

An array of at least 4 points. These are cloned and may be temporary.



The documentation for this class was generated from the following file: