public final enum

ShapeMotion

extends Enum<E extends Enum<E>>
java.lang.Object
   ↳ java.lang.Enum<E extends java.lang.Enum<E>>
     ↳ sofia.graphics.ShapeMotion

Class Overview

Determines the physical nature of a shape and how it is simulated and how it responds to forces. TODO elaborate

Summary

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

Enum Values

public static final ShapeMotion DYNAMIC

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).

public static final ShapeMotion 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.

public static final ShapeMotion STATIC

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.

Public Methods

public static ShapeMotion fromB2BodyType (BodyType type)

This method is for internal and advanced use only. Gets the value that corresponds to the specified JBox2D BodyType.

Parameters
type the JBox2D BodyType
Returns
  • the value corresponding to the specified JBox2D BodyType

public BodyType getB2BodyType ()

This method is for internal and advanced use only. Gets the JBox2D BodyType that this value represents.

Returns
  • the JBox2D {code BodyType} that this value represents

public static ShapeMotion valueOf (String name)

public static final ShapeMotion[] values ()