- type
- class
- extends
- Shape
Polygon subtype of Shape.
Can be used to simulate any convex polygon.
Can be used to simulate any convex polygon.
Static Methods
static function box(width:Float, height:Float, weak:Bool = false):Array<nape.geom.Vec2>
Construct a polygon representing an origin centred box.
static function rect(x:Float, y:Float, width:Float, height:Float, weak:Bool = false):Array<nape.geom.Vec2>
static function regular(xRadius:Float, yRadius:Float, edgeCount:Int, angleOffset:Float = 0.0, weak:Bool = false):Array<nape.geom.Vec2>
Constructor
function
new(localVerts:Dynamic, material:nape.phys.Material = new Material(), filter:nape.dynamics.InteractionFilter = new InteractionFilter())
Instance Properties hide inherited show inherited
readonly var angDrag : Float
inherited from nape.shape.Shape
Coeffecient of angular fluid drag for this Shape.
readonly var area : Float
inherited from nape.shape.Shape
Area of the Hhape.
var body : Null<nape.phys.Body> = null
inherited from nape.shape.Shape
readonly var bounds : nape.geom.AABB
inherited from nape.shape.Shape
readonly var castBody : Null<Body>
inherited from nape.phys.Interactor
Fast equivalent to cast(interactor, Body)
readonly var castCircle : Null<Circle>
inherited from nape.shape.Shape
Faster equivalent to casting this to Circle type
readonly var castCompound : Null<Compound>
inherited from nape.phys.Interactor
Fast equivalent to cast(interactor, Compound)
readonly var castPolygon : Null<Polygon>
inherited from nape.shape.Shape
Faster equivalent to casting this to Polygon type
readonly var castShape : Null<nape.shape.Shape>
inherited from nape.phys.Interactor
Fast equivalent to cast(interactor, Shape)
readonly var cbTypes : nape.callbacks.CbTypeList = []
inherited from nape.phys.Interactor
Set of CbType's assigned to this Interactor.
readonly var edges : EdgeList
var filter : nape.dynamics.InteractionFilter = new InteractionFilter()
inherited from nape.shape.Shape
InteractionFilter used by this shape.
var fluidEnabled : Bool = false
inherited from nape.shape.Shape
var fluidProperties : nape.phys.FluidProperties = new FluidProperties();
inherited from nape.shape.Shape
var group : Null<nape.dynamics.InteractionGroup> = null
inherited from nape.phys.Interactor
InteractionGroup assigned to this Interactor.
readonly var id : Int
inherited from nape.phys.Interactor
Unique id of this Interactor.
readonly var inertia : Float
inherited from nape.shape.Shape
Non-mass weighted moment of inertia for Shape.
var localCOM : nape.geom.Vec2
inherited from nape.shape.Shape
readonly var localVerts : nape.geom.Vec2List
var material : nape.phys.Material = new Material()
inherited from nape.shape.Shape
Material used by this shape.
var sensorEnabled : Bool = false
inherited from nape.shape.Shape
readonly var type : ShapeType
inherited from nape.shape.Shape
Type of shape.
readonly var userData : Dynamic<Dynamic> = {}
inherited from nape.phys.Interactor
readonly var worldCOM : nape.geom.Vec2
inherited from nape.shape.Shape
readonly var worldVerts : nape.geom.Vec2List
Instance Methods hide inherited show inherited
contains(point:nape.geom.Vec2):Bool
inherited from nape.shape.Shape
copy():Shape
inherited from nape.shape.Shape
isBody():Bool
inherited from nape.phys.Interactor
isCircle():Bool
inherited from nape.shape.Shape
isCompound():Bool
inherited from nape.phys.Interactor
isPolygon():Bool
inherited from nape.shape.Shape
isShape():Bool
inherited from nape.phys.Interactor
rotate(angle:Float):Shape
inherited from nape.shape.Shape
scale(scalex:Float, scaley:Float):Shape
inherited from nape.shape.Shape
transform(matrix:nape.geom.Mat23):Shape
inherited from nape.shape.Shape
translate(translation:nape.geom.Vec2):Shape
inherited from nape.shape.Shape
function validity():ValidationResult
Determine validity of polygon for use in a Nape simulation.