On 26-Dec-04, at 4:19 PM, Asher Dunn wrote:
On Dec 26, 2004, at 4:16 PM, Frank Condello wrote:
On 26-Dec-04, at 3:54 PM, Asher Dunn wrote:
On Dec 26, 2004, at 9:17 AM, Daniel Lurie wrote:
If curturn is the ship's heading then it should be:
curturn=curturn+turnrate*dt
THEN
ship.turn(curturn*dt)
So * dt in both cases?
No I'd think you'd want ship.turn(curturn)... But I also think you
haven't given us enough information. What exactly is curTurn? A
vector? A quaternion? A double (angle around the Y axis)? What does
the "ship.turn" method do? Is it cumulative? Absolute?
CurTurn is a double. Ship.Turn(curTurn) is just ship.yaw(curTurn), but
I said turn because what I typed into the email was pseudo code.
OK - but I think your approach may be flawed. When working with
time-based movement/rotations I find it's easier to think of everything
as having a specific velocity at a certain point in time (in this case
angular velocity around all three axes may make the most sense). You
then add user input to the current velocity, subtract
anti-momentum/friction (and/or add positive momentum), and scale the
result to the frame delta to get the actual position/orientation for
each frame. It's a little more complicated than that in code, and
you'll need to cap velocities that reach a "top speed", but objects
will automatically get smooth acceleration/deceleration with this
approach.
Frank.
------------
Open Source RB Plugins and Classes
<http://developer.chaoticbox.com>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|