|
-
Feb 20th, 2006, 06:59 AM
#11
Re: DirectPhysics
 Originally Posted by moeur
I agree with zaza about where we should start. However we still need to decide what the end product is going to look like so that we can work toward that goal.
Here is how I picture the end product is going to be used. I'f I'm way off base then say so.
Something like this
VB Code:
Dim myPhysics As clsDirectPhysics
Set myPhysics = New clsDirectPhysics
'add bodies
Dim myBody As clsDPBody
Set myBody = New clsDPBody
With myBody
.Mass = 10 'kg
'set initial coordinates and velocity
With .Rectangular
.X = 100000 'm
.Y = 200000 'm
.Z = 0 'm
.Vx = 1000 'm/s
.Vy = 500 'm/s
.Vz = 0
End With
'Alternatively we could use spherical or cylindrical coordiantes
With .Spherical
.Radius = 223607 'm
.Theta = 0.463 'radians
.phi = 0
End With
End With
myPhysics.Bodies.Add myBody
With myBody
.Mass = 1000000 'kg
'set initial coordinates and velocity
With .Rectangular
.X = 0
.Y = 0
.Z = 0
.Vx = 0 'm/s
.Vy = 0 'm/s
.Vz = 0
End With
End With
myPhysics.Bodies.Add myBody
'use a gravitational force
Dim Force1 As clsGravity
Set Force1 = New clsGravity
myPhysics.Forces.Add Force1
Set Force1 = Nothing
'add a frictional force
Dim Force2 As clsFriction
Set Force2 = New clsFriction
Force2.Coeffecient = 0.5
myPhysics.Forces.Add Force2
Set Force2 = Nothing
'time step
Dim DeltaT As Single
DeltaT = 0.001 's
With myPhysics
'generate new coordinates
.Advance DeltaT
'see new coordinates
With .Bodies(0).Rectangular
Debug.Print .X
Debug.Print .Y
End With
End With
It would look something like that, only with a DirectX style of syntax, which is where me and damasterjo will come in and sort out.
I'll be back to respond to the other posts. Got to get back to work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|