java.lang.Object | ||
↳ | java.lang.Enum<E extends java.lang.Enum<E>> | |
↳ | sofia.graphics.ShapeMotion |
Determines the physical nature of a shape and how it is simulated and how it responds to forces. TODO elaborate
Enum Values | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ShapeMotion | DYNAMIC | Dynamic shapes are fully simulated in the physics simulation. | |||||||||
ShapeMotion | KINEMATIC | Kinematic shapes move under the physics simulation according to their velocity but do not respond to forces. |
|||||||||
ShapeMotion | STATIC | Static shapes do not move under the physics simulation, behave as if they have infinite mass, and have zero velocity. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static ShapeMotion |
fromB2BodyType(BodyType type)
This method is for internal and advanced use only.
| ||||||||||
BodyType |
getB2BodyType()
This method is for internal and advanced use only.
| ||||||||||
static ShapeMotion | valueOf(String name) | ||||||||||
final static ShapeMotion[] | values() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Enum
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.lang.Comparable
|
Dynamic shapes are fully simulated in the physics simulation. They have non-zero mass, move according to forces, and can collide with all other shape types (static, dynamic, and kinematic).
Kinematic shapes move under the physics simulation according to their velocity but do not respond to forces. They behave as if they have infinite mass. Kinematic shapes do not collide with static shapes or other kinematic shapes, but they can be involved in collisions with dynamic shapes.
An example of a kinematic shape in a game would be a moving platform that slides back and forth in a predetermined way.
Static shapes do not move under the physics simulation, behave as if they have infinite mass, and have zero velocity. Static shapes also do not collide with other static or kinematic shapes, but they can be involved in collisions with dynamic shapes.
In a game, for example, static shapes are best used to represent things like the ground, walls, and other immovable, impenetrable obstacles.
This is the default motion type for newly created shapes.
This method is for internal and advanced use only.
Gets the value that corresponds to the specified JBox2D
BodyType
.
type | the JBox2D BodyType |
---|
BodyType
This method is for internal and advanced use only.
Gets the JBox2D BodyType
that this value represents.