Class FixtureDef

java.lang.Object
org.jbox2d.dynamics.FixtureDef

public class FixtureDef extends Object
A fixture definition is used to create a fixture. This class defines an abstract fixture definition. You can reuse fixture definitions safely.
Author:
Daniel Murphy
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    float
    The density, usually in kg/m^2
    Contact filtering data;
    float
    The friction coefficient, usually in the range [0,1].
    boolean
    A sensor shape collects contact information but never generates a collision response.
    float
    The restitution (elasticity) usually in the range [0,1].
    The shape, this must be set.
    Use this to store application specific fixture data.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    The density, usually in kg/m^2
    Contact filtering data;
    float
    The friction coefficient, usually in the range [0,1].
    float
    The restitution (elasticity) usually in the range [0,1].
    The shape, this must be set.
    Use this to store application specific fixture data.
    boolean
    A sensor shape collects contact information but never generates a collision response.
    void
    setDensity(float density)
    The density, usually in kg/m^2
    void
    setFilter(Filter filter)
    Contact filtering data;
    void
    setFriction(float friction)
    The friction coefficient, usually in the range [0,1].
    void
    setRestitution(float restitution)
    The restitution (elasticity) usually in the range [0,1].
    void
    setSensor(boolean isSensor)
    A sensor shape collects contact information but never generates a collision response.
    void
    setShape(Shape shape)
    The shape, this must be set.
    void
    setUserData(Object userData)
    Use this to store application specific fixture data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • shape

      public Shape shape
      The shape, this must be set. The shape will be cloned, so you can create the shape on the stack.
    • userData

      public Object userData
      Use this to store application specific fixture data.
    • friction

      public float friction
      The friction coefficient, usually in the range [0,1].
    • restitution

      public float restitution
      The restitution (elasticity) usually in the range [0,1].
    • density

      public float density
      The density, usually in kg/m^2
    • isSensor

      public boolean isSensor
      A sensor shape collects contact information but never generates a collision response.
    • filter

      public Filter filter
      Contact filtering data;
  • Constructor Details

    • FixtureDef

      public FixtureDef()
  • Method Details

    • getShape

      public Shape getShape()
      The shape, this must be set. The shape will be cloned, so you can create the shape on the stack.
    • setShape

      public void setShape(Shape shape)
      The shape, this must be set. The shape will be cloned, so you can create the shape on the stack.
    • getUserData

      public Object getUserData()
      Use this to store application specific fixture data.
    • setUserData

      public void setUserData(Object userData)
      Use this to store application specific fixture data.
    • getFriction

      public float getFriction()
      The friction coefficient, usually in the range [0,1].
    • setFriction

      public void setFriction(float friction)
      The friction coefficient, usually in the range [0,1].
    • getRestitution

      public float getRestitution()
      The restitution (elasticity) usually in the range [0,1].
    • setRestitution

      public void setRestitution(float restitution)
      The restitution (elasticity) usually in the range [0,1].
    • getDensity

      public float getDensity()
      The density, usually in kg/m^2
    • setDensity

      public void setDensity(float density)
      The density, usually in kg/m^2
    • isSensor

      public boolean isSensor()
      A sensor shape collects contact information but never generates a collision response.
    • setSensor

      public void setSensor(boolean isSensor)
      A sensor shape collects contact information but never generates a collision response.
    • getFilter

      public Filter getFilter()
      Contact filtering data;
    • setFilter

      public void setFilter(Filter filter)
      Contact filtering data;