diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/physics/MobileBasePhysicsManager.java b/src/main/java/com/neuronrobotics/bowlerstudio/physics/MobileBasePhysicsManager.java index ff0e2c19..1c936e01 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/physics/MobileBasePhysicsManager.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/physics/MobileBasePhysicsManager.java @@ -52,9 +52,9 @@ private IPhysicsUpdate getUpdater(RigidBody body, IMU base) { Vector3f oldavelocity = new Vector3f(0f, 0f, 0f); Vector3f oldvelocity = new Vector3f(0f, 0f, 0f); Vector3f gravity = new Vector3f(); - private Quat4f orentation = new Quat4f(); + private Quat4f orientation = new Quat4f(); Transform gravTrans = new Transform(); - Transform orentTrans = new Transform(); + Transform orientTrans = new Transform(); Vector3f avelocity = new Vector3f(); Vector3f velocity = new Vector3f(); @@ -65,25 +65,25 @@ public void update(float timeStep) { body.getLinearVelocity(velocity); body.getGravity(gravity); - body.getOrientation(orentation); + body.getOrientation(orientation); TransformFactory.nrToBullet(new TransformNR(gravity.x, gravity.y, gravity.z, new RotationNR()), gravTrans); TransformFactory.nrToBullet( - new TransformNR(0, 0, 0, orentation.w, orentation.x, orentation.y, orentation.z), orentTrans); - orentTrans.inverse(); - orentTrans.mul(gravTrans); + new TransformNR(0, 0, 0, orientation.w, orientation.x, orientation.y, orientation.z), orientTrans); + orientTrans.inverse(); + orientTrans.mul(gravTrans); // A=DeltaV / DeltaT Double rotxAcceleration = (double) ((oldavelocity.x - avelocity.x) / timeStep); Double rotyAcceleration = (double) ((oldavelocity.y - avelocity.y) / timeStep); Double rotzAcceleration = (double) ((oldavelocity.z - avelocity.z) / timeStep); Double xAcceleration = (double) (((oldvelocity.x - velocity.x) / timeStep) / PhysicsGravityScalar) - + (orentTrans.origin.x / PhysicsGravityScalar); + + (orientTrans.origin.x / PhysicsGravityScalar); Double yAcceleration = (double) (((oldvelocity.y - velocity.y) / timeStep) / PhysicsGravityScalar) - + (orentTrans.origin.y / PhysicsGravityScalar); + + (orientTrans.origin.y / PhysicsGravityScalar); Double zAcceleration = (double) (((oldvelocity.z - velocity.z) / timeStep) / PhysicsGravityScalar) - + (orentTrans.origin.z / PhysicsGravityScalar); + + (orientTrans.origin.z / PhysicsGravityScalar); // tell the virtual IMU the system updated base.setVirtualState(new IMUUpdate(xAcceleration, yAcceleration, zAcceleration, rotxAcceleration, rotyAcceleration, rotzAcceleration, base.currentTimeMillis())); diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/Mirror.java b/src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/Mirror.java index 3c1e7918..33c9b54b 100644 --- a/src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/Mirror.java +++ b/src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/Mirror.java @@ -15,7 +15,7 @@ public class Mirror extends CaDoodleOperation { @Expose(serialize = true, deserialize = true) - private MirrorOrentation location; + private MirrorOrientation location; @Expose(serialize = true, deserialize = true) private List names = new ArrayList(); @Expose(serialize = true, deserialize = true) @@ -60,13 +60,13 @@ public List process(List incoming) { Transform mirroringCenter = new Transform().movex(base.getCenterX()).movey(base.getCenterY()) .movez(base.getCenterZ()); Transform sc = new Transform(); - if (location == MirrorOrentation.x) { + if (location == MirrorOrientation.x) { sc = new Transform().scaleX(-1); } - if (location == MirrorOrentation.y) { + if (location == MirrorOrientation.y) { sc = new Transform().scaleY(-1); } - if (location == MirrorOrentation.z) { + if (location == MirrorOrientation.z) { sc = new Transform().scaleZ(-1); } Transform scale = sc; @@ -116,13 +116,13 @@ private CSG mirror(CSG csg, String name) { Transform mirroringCenter = new Transform().movex(t.getCenterX()).movex(t.getCenterY()).movez(t.getCenterZ()); CSG centered = t.transformed(mirroringCenter.inverse()); - if (location == MirrorOrentation.x) { + if (location == MirrorOrientation.x) { centered = centered.mirrorx(); } - if (location == MirrorOrentation.y) { + if (location == MirrorOrientation.y) { centered = centered.mirrory(); } - if (location == MirrorOrentation.z) { + if (location == MirrorOrientation.z) { centered = centered.mirrorz(); } centered = centered.transformed(mirroringCenter); @@ -130,11 +130,11 @@ private CSG mirror(CSG csg, String name) { return centered.setName(name).syncProperties(getCaDoodleFile().getCsgDBinstance(), csg); } - public MirrorOrentation getLocation() { + public MirrorOrientation getLocation() { return location; } - public Mirror setLocation(MirrorOrentation location) { + public Mirror setLocation(MirrorOrientation location) { this.location = location; return this; } diff --git a/src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/MirrorOrentation.java b/src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/MirrorOrientation.java similarity index 100% rename from src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/MirrorOrentation.java rename to src/main/java/com/neuronrobotics/bowlerstudio/scripting/cadoodle/MirrorOrientation.java