Switched attribute name from "radpersec" to "velocity".
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@63 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -47,7 +47,7 @@ public class Rotator extends ModelController
|
|||||||
{
|
{
|
||||||
super.configure(props, target);
|
super.configure(props, target);
|
||||||
String axisstr = props.getProperty("axis", "x"),
|
String axisstr = props.getProperty("axis", "x"),
|
||||||
rpsstr = props.getProperty("radpersec", "3.14");
|
velstr = props.getProperty("velocity", "3.14");
|
||||||
if (axisstr.equalsIgnoreCase("x")) {
|
if (axisstr.equalsIgnoreCase("x")) {
|
||||||
_axis = Vector3f.UNIT_X;
|
_axis = Vector3f.UNIT_X;
|
||||||
} else if (axisstr.equalsIgnoreCase("y")) {
|
} else if (axisstr.equalsIgnoreCase("y")) {
|
||||||
@@ -65,9 +65,9 @@ public class Rotator extends ModelController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
_radpersec = Float.parseFloat(rpsstr);
|
_velocity = Float.parseFloat(velstr);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
Log.warning("Invalid rotation rate [radpersec=" + rpsstr + "].");
|
Log.warning("Invalid angular velocity [velocity=" + velstr + "].");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ public class Rotator extends ModelController
|
|||||||
if (!isActive()) {
|
if (!isActive()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_rot.fromAngleNormalAxis(time * _radpersec, _axis);
|
_rot.fromAngleNormalAxis(time * _velocity, _axis);
|
||||||
_target.getLocalRotation().multLocal(_rot);
|
_target.getLocalRotation().multLocal(_rot);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ public class Rotator extends ModelController
|
|||||||
}
|
}
|
||||||
super.putClone(rstore, properties);
|
super.putClone(rstore, properties);
|
||||||
rstore._axis = _axis;
|
rstore._axis = _axis;
|
||||||
rstore._radpersec = _radpersec;
|
rstore._velocity = _velocity;
|
||||||
return rstore;
|
return rstore;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ public class Rotator extends ModelController
|
|||||||
{
|
{
|
||||||
super.writeExternal(out);
|
super.writeExternal(out);
|
||||||
out.writeObject(_axis);
|
out.writeObject(_axis);
|
||||||
out.writeFloat(_radpersec);
|
out.writeFloat(_velocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface Externalizable
|
// documentation inherited from interface Externalizable
|
||||||
@@ -112,14 +112,14 @@ public class Rotator extends ModelController
|
|||||||
{
|
{
|
||||||
super.readExternal(in);
|
super.readExternal(in);
|
||||||
_axis = (Vector3f)in.readObject();
|
_axis = (Vector3f)in.readObject();
|
||||||
_radpersec = in.readFloat();
|
_velocity = in.readFloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The axis about which to rotate. */
|
/** The axis about which to rotate. */
|
||||||
protected Vector3f _axis;
|
protected Vector3f _axis;
|
||||||
|
|
||||||
/** The velocity at which to rotate in radians per second. */
|
/** The velocity at which to rotate in radians per second. */
|
||||||
protected float _radpersec;
|
protected float _velocity;
|
||||||
|
|
||||||
/** A temporary quaternion. */
|
/** A temporary quaternion. */
|
||||||
protected Quaternion _rot = new Quaternion();
|
protected Quaternion _rot = new Quaternion();
|
||||||
|
|||||||
Reference in New Issue
Block a user