Skip to main content
gamedev.net
🔒 Locked

motion

Started by ghost_city Jan 28, 2004 at 4:58 PM 1 replies 400+ views
Original Post
ghost_city
ghost_city
Hi all I have just reached a point in my small engine, where i am building a controller for objects.I need a little push from other hobby programers or pros, into the interface for the class I started a test for linearMotion that went like this. distance = time * speed; trans = distance * direction; position += translation; Is this right and if not please give example for your object motion. objests are meshes not billboards.
fries with that
grhodes_at_work
grhodes_at_work
Looks like a good start to me. Once you start to worry about smooth acceleration, due to gravity or forces, you''ll have another equation in there that updates the speed appropriately. There are plenty of discussions about that in the forum archives. Also, there are some links in the Forum FAQ that may be useful.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
oliii
oliii
yeah. As a small note, I''d use different notation.

Velocity = Direction * Speed;
Position += Velocity * dt;

it all depends what type of motion you want.

if you want uncontrolled motion, for say, falling crates, rocks, particles, you can do

Acceleration = Vector(0, -9.81, 0); // gravity
Velocity += Acceleration * time;
Position += Velocity * time;

but if it''s for a camera, you''re better of with your solution.
Everything is better with Metal.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.