Sofia API Reference

  • Package Index
  • Class Index
  • Packages
  • sofia.app
  • sofia.content
  • sofia.data
  • sofia.graphics
    • Interfaces
    • Joint
    • PropertyTransformer
    • Classes
    • AbstractJoint
    • Anchor
    • Color
    • CoordinateSystem
    • DirectionalPad
    • DistanceJoint
    • ElasticInInterpolator
    • ElasticInOutInterpolator
    • ElasticOutInterpolator
    • FillableShape
    • FillableShape.Animator
    • Geometry
    • Image
    • LineShape
    • MotionStep
    • OvalShape
    • PointAndAnchor
    • Polygon
    • PolygonShape
    • Predicate
    • RectangleShape
    • RevoluteJoint
    • Shape
    • Shape.Animator
    • Shape.Filter
    • ShapeField
    • ShapeFilter
    • ShapeSet
    • ShapeView
    • SizeF
    • StrokedShape
    • StrokedShape.Animator
    • TextShape
    • TextShape.Animator
    • Timings
    • ViewEdges
    • ZIndexComparator
    • Enums
    • RepeatMode
    • ShapeMotion
  • sofia.util
  • sofia.view
  • sofia.widget

public final enum
ShapeMotion

extends Enum<E extends Enum<E>>

Inheritance

  • 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()
Methods inherited from class java.lang.Enum
final Object clone()
int compareTo(Object arg0)
final int compareTo(E arg0)
final boolean equals(Object arg0)
final void finalize()
final Class<E> getDeclaringClass()
final int hashCode()
final String name()
final int ordinal()
String toString()
static <T extends Enum<T>> T valueOf(Class<T> arg0, String arg1)
Methods inherited from class java.lang.Object
Object clone()
boolean equals(Object arg0)
void finalize()
final Class<?> getClass()
int hashCode()
final void notify()
final void notifyAll()
String toString()
final void wait()
final void wait(long arg0, int arg1)
final void wait(long arg0)
Methods inherited from interface java.lang.Comparable
abstract int compareTo(T arg0)

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