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

scaleform.physics.Body object reference

Description

Interface for physics properties of a vgx actor.

Functions

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

boolean

Returns true if the body is active and false otherwise.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

number

The angle of the body.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

number

Angular damping of the body.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

number

The angular velocity.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

impulse :

number

The angular impulse applied.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

force :

scaleform.Point

The force applied to the object.

point :

scaleform.Point

The world point at which the force is applied.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

center :

scaleform.Point

The force applied to the body's center.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

impulse :

scaleform.Point

The impulse applied to the point.

point :

scaleform.Point

The point at which the impulse is applied.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

impulse :

scaleform.Point

The impulse to be applied.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

torque :

number

The torque applied to the body.

Returns
This function does not return any values.

This affects the angular velocity.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

boolean

Returns true if the body is awake and false otherwise.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

boolean

Returns true if enabled to detect continuous collision and false otherwise.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

scaleform.PhysicsBodyComponent

The body component which owns the physics body.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

index :

integer

The index at which the fixture is returned from 1 to fixture count.

Returns

scaleform.physics.Fixture

The fixture attached to a body.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

number

The gravity scale on the body.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

number

Inertia of the body.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

scaleform.physics.Joint[]

The list of Joints that are attached to this body.

The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

number

Linear damping of the body.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

scaleform.Point

The linear velocity.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

local :

scaleform.Point

The local point coordinates.

Returns

scaleform.Point

Linear velocity of local point.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

world :

scaleform.Point

The world point coordinates.

Returns

scaleform.Point

Linear velocity of world point.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

scaleform.Point

The local position.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

local :

scaleform.Point

The local point coordinates.

Returns

scaleform.Point

The world coordinates.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

local :

scaleform.Point

The coordinates of local vector.

Returns

scaleform.Point

The world coordinates.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

number

The mass of the body.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

scaleform.physics.MassData

The mass data of the body.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

number

The number of fixtures

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

scaleform.Point

The position of the body.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

boolean

Returns true if the body rotation is locked and false otherwise.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

flag :

boolean

A flag to set/unset active nature of body.

Returns
This function does not return any values.

An inactive body is not simulated and cannot be collided with or woken up.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

damping :

number

The angular damping of the body.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

omega :

number

The angular velocity.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

flag :

boolean

A flag to set the body to sleep.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

flag :

boolean

A flag to enable/disable continuous collision detection.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

scale :

number

The gravity scale factor.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

damping :

number

The linear damping of the body.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

velocity :

scaleform.Point

The linear velocity of the body

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

data :

scaleform.physics.MassData

The mass data of the body.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

flag :

boolean

A flag to lock/unlock rotation.

Returns
This function does not return any values.

This causes the mass to be reset.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

flag :

boolean

A flag to set the sleeping nature of the body.

Returns
This function does not return any values.
Parameters

self :

scaleform.physics.Body

The physics body currently in use.

pos :

scaleform.Point

The position of the body in Physics World coordinates.

angle :

number

The rotation of the body in radians.

Returns
This function does not return any values.

Manipulating a body's transform may cause non-physical behavior.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

type :

scaleform.physics.BodyTypes

The body type.

Returns
This function does not return any values.

This may alter the mass and velocity.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

boolean

Returns true if the body is allowed to sleep and false otherwise.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

scaleform.physics.BodyTypes

The body type.

Can be one of Type_Static, Type_Kinematic or Type_Dynamic.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

scaleform.physics.World

The World that own this body.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

Returns

scaleform.Point

The world position.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

world :

scaleform.Point

The world point coordinates.

Returns

scaleform.Point

The local point.

Parameters

self :

scaleform.physics.Body

The physics body currently in use.

world :

scaleform.Point

The coordinates of world vector.

Returns

scaleform.Point

A local vector.

 scaleform.physics.Fixture.body (self) : scaleform.physics.Body
Returns the body which owns this fixture.
 scaleform.physics.Joint.body_a (self) : scaleform.physics.Body
Returns the first body of the bodies that are currently linked through this joint.
 scaleform.physics.Joint.body_b (self) : scaleform.physics.Body
Returns the second body of the bodies that are currently linked through this joint.
 scaleform.PhysicsBodyComponent.body (self) : scaleform.physics.Body
Returns the body contained in the physics body component.
 scaleform.physics.Fixture.create (body, shape, density) : scaleform.physics.Fixture
Creates a fixture and attaches it to the body.
 scaleform.physics.World.add_body (self, body)
Adds a body to the world/simulation.
 scaleform.physics.Body.active (self) : boolean
Determines whether the body is active or not.
 self : scaleform.physics.Body
The physics body currently in use.
 boolean  scaleform.physics.Body
Interface for physics properties of a vgx actor.
true or false.  scaleform.physics.Body.angle (self) : number
Returns the angle of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 numberA numeric value.  scaleform.physics.Body.angular_damping (self) : number
Gets the angular damping of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 number  scaleform.physics.Body.angular_velocity (self) : number
Returns the angular velocity of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 number  scaleform.physics.Body.apply_angular_impulse (self, impulse)
Applies an angular impulse.
 self : scaleform.physics.Body
The physics body currently in use.
 impulse : number
The angular impulse applied.
 scaleform.physics.Body.apply_force (self, force, point)
Applies a force to the object at a given world point.
 self : scaleform.physics.Body
The physics body currently in use.
 force : scaleform.Point
The force applied to the object.
 point : scaleform.Point
The world point at which the force is applied.
 scaleform.Point
Point should be in the form of a table {x=a, y=b}
{ PropertyType : string, x : number, y : number, }
 scaleform.physics.Body.apply_force_to_center (self, center)
Applies a force to the body's center of mass.
 self : scaleform.physics.Body
The physics body currently in use.
 center : scaleform.Point
The force applied to the body's center.
 scaleform.physics.Body.apply_linear_impulse (self, impulse, point)
Applies an impulse at a point.
 self : scaleform.physics.Body
The physics body currently in use.
 impulse : scaleform.Point
The impulse applied to the point.
 point : scaleform.Point
The point at which the impulse is applied.
 scaleform.physics.Body.apply_linear_impulse_to_center (self, impulse)
Applies an impulse to the body's center of mass.
 self : scaleform.physics.Body
The physics body currently in use.
 impulse : scaleform.Point
The impulse to be applied.
 scaleform.physics.Body.apply_torque (self, torque)
Applies a torque.
 self : scaleform.physics.Body
The physics body currently in use.
 torque : number
The torque applied to the body.
 scaleform.physics.Body.awake (self) : boolean
Determines whether the body is awake or not.
 self : scaleform.physics.Body
The physics body currently in use.
 boolean  scaleform.physics.Body.bullet (self) : boolean
Determines the bullet status of the body, whether the flag is enabled/disabled to detect continuous collision.
 self : scaleform.physics.Body
The physics body currently in use.
 boolean  scaleform.physics.Body.component (self) : scaleform.PhysicsBodyComponent
Get the physics body component which owns the physics body.
 self : scaleform.physics.Body
The physics body currently in use.
 scaleform.PhysicsBodyComponent
The body component which owns the physics body.
 scaleform.PhysicsBodyComponent
Describes a Actor's physical properties.
 scaleform.physics.Body.fixture_by_index (self, index) : scaleform.physics.Fixture
Returns the fixture at the specified index.
 self : scaleform.physics.Body
The physics body currently in use.
 index : integer
The index at which the fixture is returned from 1 to fixture count.
 scaleform.physics.Fixture
The fixture attached to a body.
A strictly integral numeric value, with no decimal component.  scaleform.physics.Fixture
An interface to attach shapes to the fixtures.
 scaleform.physics.Body.gravity_scale (self) : number
Gets the gravity scale of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 number  scaleform.physics.Body.inertia (self) : number
Gets the rotational inertia of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 number  scaleform.physics.Body.joint_list (self) : scaleform.physics.Joint[]
Gets a list of Joints that are attached to this body.
 self : scaleform.physics.Body
The physics body currently in use.
 scaleform.physics.Joint[]
The list of Joints that are attached to this body.
The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
 scaleform.physics.Joint
An interface for the physics properties of the joint between two physics bodies.
 scaleform.physics.Body.linear_damping (self) : number
Gets the linear damping of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 number  scaleform.physics.Body.linear_velocity (self) : scaleform.Point
Returns the linear velocity of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 scaleform.Point
The linear velocity.
 scaleform.physics.Body.linear_velocity_from_local_point (self, local) : scaleform.Point
Gets the linear velocity of local point attached to this body.
 self : scaleform.physics.Body
The physics body currently in use.
 local : scaleform.Point
The local point coordinates.
 scaleform.Point
Linear velocity of local point.
 scaleform.physics.Body.linear_velocity_from_world_point (self, world) : scaleform.Point
Gets the linear velocity of world point attached to this body.
 self : scaleform.physics.Body
The physics body currently in use.
 world : scaleform.Point
The world point coordinates.
 scaleform.Point
Linear velocity of world point.
 scaleform.physics.Body.local_center (self) : scaleform.Point
Returns the local position of the body's center of mass.
 self : scaleform.physics.Body
The physics body currently in use.
 scaleform.Point
The local position.
 scaleform.physics.Body.local_to_world_point (self, local) : scaleform.Point
Gets the world coordinates of a point given the local coordinates.
 self : scaleform.physics.Body
The physics body currently in use.
 local : scaleform.Point
The local point coordinates.
 scaleform.Point
The world coordinates.
 scaleform.physics.Body.local_to_world_vector (self, local) : scaleform.Point
Gets the world coordinates of a vector given the local coordinates.
 self : scaleform.physics.Body
The physics body currently in use.
 local : scaleform.Point
The coordinates of local vector.
 scaleform.Point
The world coordinates.
 scaleform.physics.Body.mass (self) : number
Gets the mass of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 number  scaleform.physics.Body.mass_data (self) : scaleform.physics.MassData
Returns the mass data of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 scaleform.physics.MassData
The mass data of the body.
 scaleform.physics.MassData (init) : scaleform.physics.MassData
Create an initialized mass data table.
 scaleform.physics.Body.num_fixtures (self) : number
Returns the number of fixtures attached to a body.
 self : scaleform.physics.Body
The physics body currently in use.
 number  scaleform.physics.Body.position (self) : scaleform.Point
Returns the position of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 scaleform.Point
The position of the body.
 scaleform.physics.Body.reset_mass_data (self)
Resets the mass data properties of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 scaleform.physics.Body.rotation_fixed (self) : boolean
Determines whether rotation is locked on the body.
 self : scaleform.physics.Body
The physics body currently in use.
 boolean  scaleform.physics.Body.set_active (self, flag)
Sets whether the body is active in the world.
 self : scaleform.physics.Body
The physics body currently in use.
 flag : boolean
A flag to set/unset active nature of body.
 scaleform.physics.Body.set_angular_damping (self, damping)
Set the angular damping of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 damping : number
The angular damping of the body.
 scaleform.physics.Body.set_angular_velocity (self, omega)
Sets the angular velocity of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 omega : number
The angular velocity.
 scaleform.physics.Body.set_awake (self, flag)
Sets the sleep state of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 flag : boolean
A flag to set the body to sleep.
 scaleform.physics.Body.set_bullet (self, flag)
Sets the flag that enables and disables continuous collision detection which is used for very fast moving objects.
 self : scaleform.physics.Body
The physics body currently in use.
 flag : boolean
A flag to enable/disable continuous collision detection.
 scaleform.physics.Body.set_gravity_scale (self, scale)
Set the gravity scale on the body.
 self : scaleform.physics.Body
The physics body currently in use.
 scale : number
The gravity scale factor.
 scaleform.physics.Body.set_linear_damping (self, damping)
Set the linear damping of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 damping : number
The linear damping of the body.
 scaleform.physics.Body.set_linear_velocity (self, velocity)
Sets the linear velocity of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 velocity : scaleform.Point
The linear velocity of the body
 scaleform.physics.Body.set_mass_data (self, data)
Sets the mass data of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 data : scaleform.physics.MassData
The mass data of the body.
 scaleform.physics.Body.set_rotation_fixed (self, flag)
Locks or unlocks rotation on an object.
 self : scaleform.physics.Body
The physics body currently in use.
 flag : boolean
A flag to lock/unlock rotation.
 scaleform.physics.Body.set_sleeping_allowed (self, flag)
Sets the flag to determine whether the object is able to sleep when in resting contact.
 self : scaleform.physics.Body
The physics body currently in use.
 flag : boolean
A flag to set the sleeping nature of the body.
 scaleform.physics.Body.set_transform (self, pos, angle)
Sets the body's position and rotation.This breaks any contacts and wakes the other bodies.
 self : scaleform.physics.Body
The physics body currently in use.
 pos : scaleform.Point
The position of the body in Physics World coordinates.
 angle : number
The rotation of the body in radians.
 scaleform.physics.Body.set_type (self, type)
Set the type of this body.
 self : scaleform.physics.Body
The physics body currently in use.
 type : scaleform.physics.BodyTypes
The body type.
 scaleform.physics.BodyTypes
The different types of physics bodies.
 scaleform.physics.Body.sleeping_allowed (self) : boolean
Determines the sleeping behavior of the body.
 self : scaleform.physics.Body
The physics body currently in use.
 boolean  scaleform.physics.Body.type (self) : scaleform.physics.BodyTypes
Get the type of this body.
 self : scaleform.physics.Body
The physics body currently in use.
 scaleform.physics.BodyTypes
The body type.
 scaleform.physics.Body.world (self) : scaleform.physics.World
Returns the World that this body is part of.
 self : scaleform.physics.Body
The physics body currently in use.
 scaleform.physics.World
The World that own this body.
 scaleform.physics.World
Manages all physics entities, dynamic simulation, and asynchronous queries.
 scaleform.physics.Body.world_center (self) : scaleform.Point
Returns the world position of the body's center of mass.
 self : scaleform.physics.Body
The physics body currently in use.
 scaleform.Point
The world position.
 scaleform.physics.Body.world_to_local_point (self, world) : scaleform.Point
Gets a local point relative to the body's origin given a world point.
 self : scaleform.physics.Body
The physics body currently in use.
 world : scaleform.Point
The world point coordinates.
 scaleform.Point
The local point.
 scaleform.physics.Body.world_to_local_vector (self, world) : scaleform.Point
Gets a local vector given a world vector.
 self : scaleform.physics.Body
The physics body currently in use.
 world : scaleform.Point
The coordinates of world vector.
 scaleform.Point
A local vector.
 self : scaleform.physics.Fixture
The fixture currently in use.
 scaleform.physics.Body
The physics body.
 self : scaleform.physics.Joint
The joint currently in use.
 scaleform.physics.Body
The body linked through the joint.
 self : scaleform.physics.Joint
The joint currently in use.
 scaleform.physics.Body
The body linked through the joint.
 self : scaleform.PhysicsBodyComponent
The physics body component.
 scaleform.physics.Body
Returns the created physics body.
 body : scaleform.physics.Body
The physics body to which the fixture is attached.
 shape : scaleform.physics.ShapeDef
The shape definition data.
 density : number
Density of the body.
 scaleform.physics.Fixture
The newly created Fixture.
 self : scaleform.physics.World
The physics World that is currently in use.
 body : scaleform.physics.Body
The physics body to be added to the simulation.
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.
 scaleform.physics.ShapeDef (init) : scaleform.physics.ShapeDef
Create an initialized shape definition table.
 init : scaleform.physics.ShapeDef?
An table arguments to initialize the returned physics.ShapeDef table with. [more...]
The ? notation indicates that this type is optional: there may be zero or one instances of it.
 scaleform.physics.ShapeDef
Returns a fully constructed shape definition 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.