Scaleform Studio Lua API Reference: scaleform.physics.Shape object reference

scaleform.physics.Shape object reference

Description

Represents shape used in fixtures.

Functions

Parameters

self :

scaleform.physics.Shape

The shape that is cloned.

Returns

scaleform.physics.Shape

The new Shape.

Parameters

self :

scaleform.physics.Shape

The shape currently in use.

position :

scaleform.Point

The world position of the shape.

rotation :

number

The world rotation of the shape.

chainShapeChildIndex :

integer?

The child shape index.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

scaleform.Rect

Returns the computed aabb for the child shape.

chainShapeChildIndex only required for ChainShapes and ignored by all others.

Parameters

self :

scaleform.physics.Shape

The shape currently in use.

density :

number

The density in kilograms per meter squared.

Returns

scaleform.physics.MassData

Returns the mass data for this shape.

Parameters

self :

scaleform.physics.Shape

The shape currently in use.

Returns

number

Number of children.

Parameters

self :

scaleform.physics.Shape

The shape currently in use.

input :

scaleform.physics.RayCastInput

The ray-cast input parameters.

transform :

scaleform.physics.Transform

The transform to be applied to the shape.

chainShapeChildIndex :

integer?

The chain child shape index.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

boolean

Returns true if the ray cast hits a child shape and false otherwise.

scaleform.physics.RayCastOutput

The ray-cast results

chainShapeChildIndex only required for ChainShapes and ignored by all others.

Parameters

self :

scaleform.physics.Shape

The shape currently in use.

position :

scaleform.Point

The position of the point.

rotation :

number

Rotation of the shape.

point :

scaleform.Point

The point tested for.

Returns

boolean

Returns true if the point is in the shape and false otherwise.

Parameters

self :

scaleform.physics.Shape

The shape currently in use.

Returns

scaleform.physics.ShapeTypes

The type of shape.

 scaleform.physics.ChainShape
Represents a chain shape consisting of multiple line segments.
 scaleform.physics.CircleShape
Represents a circle that extends the shape and adds a radius and a local position.
 scaleform.physics.EdgeShape
Represents an edge shape consisting of a line segment.
 scaleform.physics.PolygonShape
Represents a polygon shape with up to 8 sides.
 scaleform.physics.Shape.clone (self) : scaleform.physics.Shape
Creates a new copy of the shape.
 self : scaleform.physics.Shape
The shape that is cloned.
 scaleform.physics.Shape
The new Shape.
 scaleform.physics.Shape
Represents shape used in fixtures.
 scaleform.physics.Shape.compute_aabb (self, position, rotation, chainShapeChildIndex) : scaleform.Rect
Given a transform, compute the associated axis aligned bounding box for a child shape.
 self : scaleform.physics.Shape
The shape currently in use.
 position : scaleform.Point
The world position of the shape.
 rotation : number
The world rotation of the shape.
 chainShapeChildIndex : integer?
The child shape index.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 scaleform.Rect
Returns the computed aabb for the child shape.
 scaleform.Point
Point should be in the form of a table {x=a, y=b}
{ PropertyType : string, x : number, y : number, }
A numeric value.A strictly integral numeric value, with no decimal component.  scaleform.Rect
A rectangle based upon two points.
{ x1 : number, x2 : number, y1 : number, y2 : number, }
 scaleform.physics.Shape.compute_mass (self, density) : scaleform.physics.MassData
Compute the mass properties of this shape using its dimensions and density.
 self : scaleform.physics.Shape
The shape currently in use.
 density : number
The density in kilograms per meter squared.
 scaleform.physics.MassData
Returns the mass data for this shape.
 scaleform.physics.MassData (init) : scaleform.physics.MassData
Create an initialized mass data table.
 scaleform.physics.Shape.num_children (self) : number
Returns the number of children of the shape.
 self : scaleform.physics.Shape
The shape currently in use.
 number  scaleform.physics.Shape.ray_cast (self, input, transform, chainShapeChildIndex) : boolean, scaleform.physics.RayCastOutput
Cast a ray against a child shape.
 self : scaleform.physics.Shape
The shape currently in use.
 input : scaleform.physics.RayCastInput
The ray-cast input parameters.
 transform : scaleform.physics.Transform
The transform to be applied to the shape.
 chainShapeChildIndex : integer?
The chain child shape index.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 boolean  scaleform.physics.RayCastOutput
The ray-cast results
 scaleform.physics.RayCastInput (init) : scaleform.physics.RayCastInput
Create an initialized ray cast input table.
 scaleform.physics.Transform (init) : scaleform.physics.Transform
Create an initialized transform table.
true or false.  scaleform.physics.RayCastOutput (init) : scaleform.physics.RayCastOutput
Create an initialized ray cast output table.
 scaleform.physics.Shape.test_point (self, position, rotation, point) : boolean
Test a point for containment in this shape.
 self : scaleform.physics.Shape
The shape currently in use.
 position : scaleform.Point
The position of the point.
 rotation : number
Rotation of the shape.
 point : scaleform.Point
The point tested for.
 boolean  scaleform.physics.Shape.type (self) : scaleform.physics.ShapeTypes
Returns the type of shape.
 self : scaleform.physics.Shape
The shape currently in use.
 scaleform.physics.ShapeTypes
The type of shape.
 scaleform.physics.ShapeTypes
The different types of shapes.
A string of characters.  init : scaleform.physics.MassData?
An table arguments to initialize the returned physics.MassData table with. [more...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 scaleform.physics.MassData
Returns a fully constructed mass data table.
 init : scaleform.physics.RayCastInput?
An table arguments to initialize the returned physics.RayCastInput table with. [more...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 scaleform.physics.RayCastInput
Returns a fully constructed ray cast input table.
 init : scaleform.physics.Transform?
An table arguments to initialize the returned physics.Transform table with. [more...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 scaleform.physics.Transform
Returns a fully constructed transform table.
 init : scaleform.physics.RayCastOutput?
An table arguments to initialize the returned physics.RayCastOutput table with. [more...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 scaleform.physics.RayCastOutput
Returns a fully constructed ray cast output table.
Indicates a table.
This documentation uses the term table to mean an anonymous, temporary Lua table that contains named data values. You typically use these tables to pass data or settings to a function, or to hold data returned by a function.
Indicates an object.
This documentation uses the term object to mean a named Lua table or userdata value that maintains a state. Some object types may have multiple instances existing at the same time, each with its own state; these objects typically have creation functions or accessors that you must call in order to get an instance. Some object types have only one instance, which you always access through the object's name.
Indicates a named variable within a namespace, object or table; or an element within an enumeration.Indicates a code sample.Indicates an enumeration.
This documentation uses the term enumeration to mean a named Lua table that contains only a set of constant values. These values typically identify a predefined set of options for some setting or behavior. You might pass an enumeration value to a function, or test the value returned by a function against the items in the enumeration to see which option is currently set.
Indicates a named variable within a namespace or object that has a pre-set constant value.Indicates a category: a semantic grouping of related API elements.Indicates a namespace.
This documentation uses the term namespace to mean a named Lua table that exists in only one single instance, intended as a container for an interface of related objects, functions and data variables.
Indicates an output value returned by a function.Indicates a named function within a namespace or object.Indicates an input parameter for a function.