DynamicAnimControl: remove all mention of attachments incl. isReleased()
This commit is contained in:
parent
432085c191
commit
40be1b42b8
@ -107,8 +107,7 @@ abstract public class DacConfiguration extends AbstractPhysicsControl {
|
|||||||
// constructors
|
// constructors
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiate an enabled control without any attachments or linked bones
|
* Instantiate an enabled control without any linked bones (torso only).
|
||||||
* (torso only).
|
|
||||||
*/
|
*/
|
||||||
DacConfiguration() {
|
DacConfiguration() {
|
||||||
}
|
}
|
||||||
|
@ -127,8 +127,7 @@ public class DacLinks
|
|||||||
// constructors
|
// constructors
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiate an enabled control without any linked bones or attachments
|
* Instantiate an enabled control without any linked bones (torso only).
|
||||||
* (torso only).
|
|
||||||
*/
|
*/
|
||||||
DacLinks() {
|
DacLinks() {
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ public class DynamicAnimControl
|
|||||||
// fields
|
// fields
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* calculated total mass, not including released attachments
|
* calculated total mass
|
||||||
*/
|
*/
|
||||||
private float ragdollMass = 0f;
|
private float ragdollMass = 0f;
|
||||||
/**
|
/**
|
||||||
@ -105,8 +105,7 @@ public class DynamicAnimControl
|
|||||||
// constructors
|
// constructors
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiate an enabled control without any linked bones or attachments
|
* Instantiate an enabled control without any linked bones (torso only).
|
||||||
* (torso only).
|
|
||||||
*/
|
*/
|
||||||
public DynamicAnimControl() {
|
public DynamicAnimControl() {
|
||||||
}
|
}
|
||||||
@ -160,8 +159,7 @@ public class DynamicAnimControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the ragdoll's total mass and center of mass, excluding released
|
* Calculate the ragdoll's total mass and center of mass.
|
||||||
* attachments.
|
|
||||||
* <p>
|
* <p>
|
||||||
* Allowed only when the control IS added to a spatial.
|
* Allowed only when the control IS added to a spatial.
|
||||||
*
|
*
|
||||||
@ -187,7 +185,7 @@ public class DynamicAnimControl
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Alter the contact-response setting of the specified link and all its
|
* Alter the contact-response setting of the specified link and all its
|
||||||
* descendants (excluding released attachments). Note: recursive!
|
* descendants. Note: recursive!
|
||||||
* <p>
|
* <p>
|
||||||
* Allowed only when the control IS added to a spatial.
|
* Allowed only when the control IS added to a spatial.
|
||||||
*
|
*
|
||||||
@ -199,7 +197,6 @@ public class DynamicAnimControl
|
|||||||
boolean desiredResponse) {
|
boolean desiredResponse) {
|
||||||
verifyAddedToSpatial("change modes");
|
verifyAddedToSpatial("change modes");
|
||||||
|
|
||||||
if (!rootLink.isReleased()) {
|
|
||||||
PhysicsRigidBody rigidBody = rootLink.getRigidBody();
|
PhysicsRigidBody rigidBody = rootLink.getRigidBody();
|
||||||
rigidBody.setContactResponse(desiredResponse);
|
rigidBody.setContactResponse(desiredResponse);
|
||||||
|
|
||||||
@ -208,7 +205,6 @@ public class DynamicAnimControl
|
|||||||
setContactResponseSubtree(child, desiredResponse);
|
setContactResponseSubtree(child, desiredResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immediately put the specified link and all its ancestors (excluding the
|
* Immediately put the specified link and all its ancestors (excluding the
|
||||||
@ -240,8 +236,8 @@ public class DynamicAnimControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immediately put the specified link and all its descendants (excluding
|
* Immediately put the specified link and all its descendants into dynamic
|
||||||
* released attachments) into dynamic mode. Note: recursive!
|
* mode. Note: recursive!
|
||||||
* <p>
|
* <p>
|
||||||
* Allowed only when the control IS added to a spatial.
|
* Allowed only when the control IS added to a spatial.
|
||||||
*
|
*
|
||||||
@ -503,9 +499,8 @@ public class DynamicAnimControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recalculate the total mass of the ragdoll, not including released
|
* Recalculate the total mass of the ragdoll. Also updates the location and
|
||||||
* attachments. Also updates the location and estimated velocity of the
|
* estimated velocity of the center of mass.
|
||||||
* center of mass.
|
|
||||||
*/
|
*/
|
||||||
private void recalculateCenter() {
|
private void recalculateCenter() {
|
||||||
double massSum = 0.0;
|
double massSum = 0.0;
|
||||||
@ -514,7 +509,6 @@ public class DynamicAnimControl
|
|||||||
Vector3f tmpVector = new Vector3f();
|
Vector3f tmpVector = new Vector3f();
|
||||||
List<PhysicsLink> links = listLinks(PhysicsLink.class);
|
List<PhysicsLink> links = listLinks(PhysicsLink.class);
|
||||||
for (PhysicsLink link : links) {
|
for (PhysicsLink link : links) {
|
||||||
if (!link.isReleased()) {
|
|
||||||
PhysicsRigidBody rigidBody = link.getRigidBody();
|
PhysicsRigidBody rigidBody = link.getRigidBody();
|
||||||
float mass = rigidBody.getMass();
|
float mass = rigidBody.getMass();
|
||||||
massSum += mass;
|
massSum += mass;
|
||||||
@ -527,7 +521,6 @@ public class DynamicAnimControl
|
|||||||
tmpVector.multLocal(mass);
|
tmpVector.multLocal(mass);
|
||||||
velocitySum.addLocal(tmpVector);
|
velocitySum.addLocal(tmpVector);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
float invMass = (float) (1.0 / massSum);
|
float invMass = (float) (1.0 / massSum);
|
||||||
locationSum.mult(invMass, centerLocation);
|
locationSum.mult(invMass, centerLocation);
|
||||||
|
@ -52,8 +52,8 @@ import java.util.logging.Logger;
|
|||||||
/**
|
/**
|
||||||
* The abstract base class used by DynamicAnimControl to link pieces of a JME
|
* The abstract base class used by DynamicAnimControl to link pieces of a JME
|
||||||
* model to their corresponding collision objects in a ragdoll. Subclasses
|
* model to their corresponding collision objects in a ragdoll. Subclasses
|
||||||
* include: AttachmentLink, BoneLink, and TorsoLink. The links in each
|
* include BoneLink and TorsoLink. The links in each DynamicAnimControl form a
|
||||||
* DynamicAnimControl form a hierarchy with the TorsoLink at its root.
|
* hierarchy with the TorsoLink at its root.
|
||||||
* <p>
|
* <p>
|
||||||
* This class is shared between JBullet and Native Bullet.
|
* This class is shared between JBullet and Native Bullet.
|
||||||
*
|
*
|
||||||
@ -248,15 +248,6 @@ abstract public class PhysicsLink
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Test whether the attached model (if any) has been released.
|
|
||||||
*
|
|
||||||
* @return false unless this is an AttachmentLink
|
|
||||||
*/
|
|
||||||
public boolean isReleased() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the kinematic weight of this link.
|
* Read the kinematic weight of this link.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user