Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-04-2003, 09:34 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Post A little physics a little at a time

(I will capitalize Vector quantities)
//Acceleration\\
Simply put, Acceleration is the change in speed of an object. It can be calculated as Velocity/time. Since Velocity is a vector quantity (speed with direction), Acceleration is a vector aswell, which really just means that it can go forwards or backwards. So don't say decellerate, just say negative Acceleration.

A good example would be gravity, as something falls it increases speed (neglecting air resistance) by 9.81 meters/sec(32.2 ft/sec) every second. In graal this is roughly adding/subtracting .1 to your speed every .05 seconds.

//Forces\\
A Force, of course, is a push or pull on an object. To make things simple we normally look at objects as a point, so don't worry about where the force is acting on an object just yet. Forces are measured in Newtons and are found by taking mass*Acceleration (this means that the amount of Force needed to make an object move with an accelleration is found by multiplying that acceleration by the objects mass). Forces are vector quantities aswell, so they can be broken down into their dimemsions. Lets say Force 1 is 1 N, when we break it down we find that Force1 x is .7 and the same goes for Force1 y. This is because Fx = F*cos(ang) and Fy = F*sin(ang), where F is the main Force, Fx and Fy are the components, and ang is the angle of theForce

Now if more than one Force is acting upon an object, the Forces can be added. This is done by adding their component vectors (x,y, and z as needed). In the diagram, F1 and F2 are both 1N, but when you add their component vectors, you end up with a resultant Force of 1.4 N at 3pi/2 radians (270 deg). To find the resultant angle, you just need to find the inverse tangent of the resultant Force's components ( arctan(Fry/Frx) )


Next up, momentum (dealing with collisions) and Projectile movement
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:24 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.