public class Anchor extends PhysicsJoint
| Modifier and Type | Field and Description |
|---|---|
static java.util.logging.Logger |
logger2
message logger for this class
|
loggerloggerN| Constructor and Description |
|---|
Anchor(PhysicsSoftBody softBodyA,
int nodeIndexA,
PhysicsRigidBody rigidBodyB,
Vector3f pivotInB,
boolean allowCollisions)
Instantiate an anchor with influence=1.
|
| Modifier and Type | Method and Description |
|---|---|
Vector3f |
copyPivot(Vector3f storeResult)
Copy the location of the connection point in the rigid body at the B end.
|
PhysicsRigidBody |
getRigidBody()
Access the rigid body at the B end.
|
PhysicsSoftBody |
getSoftBody()
Access the soft body at the A end.
|
float |
influence()
Read how much influence the anchor has on the bodies.
|
boolean |
isAllowCollision()
Test whether collisions are allowed between the bodies.
|
boolean |
isEnabled()
Test whether this Anchor is enabled.
|
int |
nodeIndex()
Read the index of the anchored node in body A.
|
void |
setInfluence(float amount)
Alter how much influence the anchor has on the bodies.
|
void |
setPivotInB(Vector3f location)
Alter the pivot location in B's local coordinates.
|
countEnds, destroy, findEnd, findOtherBody, getBody, getBodyA, getBodyB, getPhysicsSpace, setBodyA, setBodyB, setNativeId, setPhysicsSpace, toStringcompareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeIdNotTracked, unassignNativeObjectpublic static final java.util.logging.Logger logger2
public Anchor(PhysicsSoftBody softBodyA, int nodeIndexA, PhysicsRigidBody rigidBodyB, Vector3f pivotInB, boolean allowCollisions)
softBodyA - the soft body for the A end (not null, alias created)nodeIndexA - the index of the node for the A end (≥0,
<numNodes)rigidBodyB - the rigid body for the B end (not null, alias created)pivotInB - the pivot location in B's scaled local coordinates (not
null, unaffected)allowCollisions - true→allow collisions between the bodies,
false→disallow such collisionspublic Vector3f copyPivot(Vector3f storeResult)
storeResult - storage for the result (modified if not null)public PhysicsRigidBody getRigidBody()
public PhysicsSoftBody getSoftBody()
public float influence()
public boolean isAllowCollision()
public int nodeIndex()
public void setInfluence(float amount)
amount - the degree of influence (≥0, ≤1, 0→no influence,
1→strong influence, default=1)public void setPivotInB(Vector3f location)
location - the desired location (not null, unaffected)public boolean isEnabled()
isEnabled in class PhysicsJoint