Core API Reference: Shape Physics Properties

From Color Infection Wiki

Jump to: navigation, search


Contents


Is Physics Enabled?

Whether or not a shape is physics enabled.

Input Parameters:

The Shape
the shape

Output Parameters:

Physics Enabled?
physics enabled or not
Is Static Shape

Whether or not a shape is static.

Input Parameters:

The Shape
the shape

Output Parameters:

Static?
static or not
Get Collision Category

Get the collision category of a shape. This property is only meaningful for phyics shapes. But this function doesn't check if the input shape is a physics shape.

Input Parameters:

The Shape
the shape

Output Parameters:

Collision Category (ccat)
the collision category
Set Collision Category

Set the collision category of a shape. This property is only meaningful for phyics shapes. But this function doesn't convert a non-physics shape into a physics shape automatically.

Input Parameters:

The Shape
the shape
Collision Category (ccat)
the collision category

Output Parameters:

(none)
Is Sensor?

Get the value of the sensor property of a shape. This property is only meaningful for phyics shapes. But this function doesn't check if the input shape is a physics shape.

Input Parameters:

The Shape
the shape

Output Parameters:

Is Sensor?
sensor shape or not
Set Sensor

Set the value of the sensor property of a shape. The sensor property is only meaningful for phyics shapes. But this function doesn't convert a non-physics shape into a physics shape automatically.

Input Parameters:

The Shape
the shape
Sensor?
sensor or not

Output Parameters:

(none)
Is Sleeping?

Whether or not a shape is sleeping.

Input Parameters:

The Shape
the shape

Output Parameters:

Is Sleeping?
sleeping or not
Set Sleeping

Set the sleeping status of shape. If a shape is set sleeping, all the brother shapes will also be set sleeping.

Input Parameters:

The Shape
the shape
Sleeping?
sleeping or not

Output Parameters:

(none)
Get Density

Get the denstiy of a physics shape. For non-physics shapes, zero is always returned.

Input Parameters:

The Shape
the shape

Output Parameters:

The Density
the density of the input shape
Get World Centroid

Set the centroid world position of a shape or its brothers

Input Parameters:

The Shape
the shape
Centroid Of Brothers?
true to return centroid of brothers, false to return centroid of the single input shape.

Output Parameters:

World Centroid X
world centroid x
World Centroid Y
world centroid y
Get Local Centroid

Set the centroid local position of a shape

Input Parameters:

The Shape
the shape

shape. Output Parameters:

Local Centroid X
local centroid x
Local Centroid Y
local centroid y
Get World Centroid

Set the centroid world position of a shape or its brothers

Input Parameters:

The Shape
the shape
Centroid Of Brothers?
true to return centroid of brothers, false to return centroid of the single input shape.

Output Parameters:

World Centroid X
world centroid x
World Centroid Y
world centroid y
Get Mass

Get the mass of a physics shape or its brothers. For non-physics shapes and the "Mass Of Brothers?" is false, zero is always returned.

Input Parameters:

The Shape
the shape
Mass Of Brothers?
true to return mass of brothers, false to return mass of the single input shape.

Output Parameters:

The Mass
the returned mass
Get Moment Of Inertia

Get the moment of inertia of a physics shape or its brothers.

Input Parameters:

The Shape
the shape
MOI Of Brothers?
true to return moment of inertia of brothers, false to return moment of inertia of the single input shape.

Output Parameters:

Moment Of Inertia
the returned moment of inertia
Get Density

Get the denstiy of a physics shape. For non-physics shapes, zero is always returned.

Input Parameters:

The Shape
the shape

Output Parameters:

The Density
the density of the input shape
Set Density

Set the denstiy of a physics shape.

Input Parameters:

The Shape
the shape
The Density
the new density of the input shape

Output Parameters:

(none)
Personal tools