org.odejava
Class JointBall

java.lang.Object
  extended by org.odejava.Joint
      extended by org.odejava.JointBall

public class JointBall
extends Joint

Created 20.12.2003 (dd.mm.yyyy)

Author:
Jani Laakso E-mail: jani.laakso@itmill.com see http://odejava.dev.java.net

Field Summary
 
Fields inherited from class org.odejava.Joint
body1, body2, BOUNCE_RANGE_MSG, deleted, feedback, group, jointGroupId, jointId, name
 
Constructor Summary
JointBall(String name, World world)
          Create a new Ball joint that belongs to the given world and has a name.
JointBall(String name, World world, JointGroup jointGroup)
          Create a new Ball joint that belongs to the given world.
JointBall(World world)
          Create a new Ball joint that belongs to the given world and does not belong to any group.
JointBall(World world, JointGroup jointGroup)
          Create a new Ball joint that belongs to the given world.
 
Method Summary
 org.openmali.vecmath2.Vector3f getAnchor()
          Get the anchor location of the joint, relative to body 1.
 void getAnchor(float[] result)
          Get the anchor location the joint, relative to body 1 and place it in the user-provided array.
 org.openmali.vecmath2.Vector3f getAnchor(org.openmali.vecmath2.Vector3f result)
          Get the anchor location of the joint, relative to body 1, and place it in the user-provided data structure.
 org.openmali.vecmath2.Vector3f getAnchor2()
          Get the anchor location of the joint, relative to body 2.
 void getAnchor2(float[] result)
          Get the anchor location the joint, relative to body 2 and place it in the user-provided array.
 org.openmali.vecmath2.Vector3f getAnchor2(org.openmali.vecmath2.Vector3f result)
          Get the anchor location of the joint, relative to body 2, and place it in the user-provided data structure.
 void setAnchor(float x, float y, float z)
          Set the anchor location to a new value, using individual values.
 void setAnchor(org.openmali.vecmath2.Vector3f position)
          Set the anchor location, relative to body 1 to a new value, using a vector.
 
Methods inherited from class org.odejava.Joint
attach, delete, enableFeedbackTracking, enableFeedbackTracking, getBody1, getBody2, getFeedback, getGroup, getName, getParam, isFeedbackTrackingEnabled, setAxis1, setAxis2, setName, setParam
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JointBall

public JointBall(World world)
Create a new Ball joint that belongs to the given world and does not belong to any group. The name is set to the null string.

Parameters:
world - The world that this belongs to

JointBall

public JointBall(String name,
                 World world)
Create a new Ball joint that belongs to the given world and has a name. The name parameter is optional. The joint is attached to the global environment.

Parameters:
name - A label string to associate with this joint
world - The world that this belongs to

JointBall

public JointBall(World world,
                 JointGroup jointGroup)
Create a new Ball joint that belongs to the given world. The JointGroup is optional and the name is set to the null string. If no group is provided, the joint is attached to the global environment.

Parameters:
world - The world that this belongs to
jointGroup - An optional group to associate this joint with

JointBall

public JointBall(String name,
                 World world,
                 JointGroup jointGroup)
Create a new Ball joint that belongs to the given world. The JointGroup and name parameters are optional. If no group is provided, the joint is attached to the global environment.

Parameters:
name - A label string to associate with this joint
world - The world that this belongs to
jointGroup - An optional group to associate this joint with
Method Detail

setAnchor

public void setAnchor(float x,
                      float y,
                      float z)
Set the anchor location to a new value, using individual values.

Parameters:
x - The x component of the the anchor location
y - The y component of the the anchor location
z - The z component of the the anchor location

setAnchor

public final void setAnchor(org.openmali.vecmath2.Vector3f position)
Set the anchor location, relative to body 1 to a new value, using a vector.

Parameters:
position - A vector holding the anchor location

getAnchor

public org.openmali.vecmath2.Vector3f getAnchor()
Get the anchor location of the joint, relative to body 1. A new Vector3f instance will be created for each request. This is identical to calling getAnchor(null).

Returns:
A new vector object containing the location

getAnchor

public org.openmali.vecmath2.Vector3f getAnchor(org.openmali.vecmath2.Vector3f result)
Get the anchor location of the joint, relative to body 1, and place it in the user-provided data structure. If the user-provided data structure is null, then a new instance is created and returned, otherwise the user provided structure is used as the return value.

Parameters:
result - An object to place the values into or null
Returns:
Either the result parameter or a new object

getAnchor

public void getAnchor(float[] result)
Get the anchor location the joint, relative to body 1 and place it in the user-provided array.

Parameters:
result - An object to place the values into

getAnchor2

public org.openmali.vecmath2.Vector3f getAnchor2()
Get the anchor location of the joint, relative to body 2. A new Vector3f instance will be created for each request. This is identical to calling getAnchor2(null).

Returns:
A new vector object containing the location

getAnchor2

public org.openmali.vecmath2.Vector3f getAnchor2(org.openmali.vecmath2.Vector3f result)
Get the anchor location of the joint, relative to body 2, and place it in the user-provided data structure. If the user-provided data structure is null, then a new instance is created and returned, otherwise the user provided structure is used as the return value.

Parameters:
result - An object to place the values into or null
Returns:
Either the result parameter or a new object

getAnchor2

public void getAnchor2(float[] result)
Get the anchor location the joint, relative to body 2 and place it in the user-provided array.

Parameters:
result - An object to place the values into