diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/CollidableObject.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/common/CollidableObject.java b/src/common/CollidableObject.java index 4c04281..5ec49f3 100644 --- a/src/common/CollidableObject.java +++ b/src/common/CollidableObject.java @@ -38,6 +38,36 @@ public abstract class CollidableObject implements Serializable { // The inverse inertia tensor in world coordinates
transient private Matrix3f inverseInertiaTensorCache;
+ /**
+ * Copy Constructor
+ * @param The CollidableObject to copy.
+ */
+ protected CollidableObject(CollidableObject o) {
+ inverseMass = o.inverseMass;
+ centerOfMass = o.centerOfMass;
+ position = o.position;
+ previousPosition = o.previousPosition;
+ velocity = o.velocity;
+ previousVelocity = o.previousVelocity;
+ forceAccumulator = o.forceAccumulator;
+ orientation = o.orientation;
+ angularVelocity = o.angularVelocity;
+ previousRotationalVelocity = o.previousRotationalVelocity;
+ torqueAccumulator = o.torqueAccumulator;
+ inverseInertiaTensor = o.inverseInertiaTensor;
+ coefficientOfRestitution = o.coefficientOfRestitution;
+ penetrationCorrection = o.penetrationCorrection;
+ dynamicFriction = o.dynamicFriction;
+ rotationalFriction = o.rotationalFriction;
+ BG = o.BG;
+ TG = o.TG;
+ node = o.node;
+ vertexCache = o.vertexCache;
+ triangleCache = o.triangleCache;
+ boundsCache = o.boundsCache;
+ inverseInertiaTensorCache = o.inverseInertiaTensorCache;
+ }
+
public CollidableObject() {
this(1);
}
|