.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old August 17th, 2007, 10:30 PM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: OT: Looking for a good physics site

The acceleration for X will be cos(theta) times the ship's engine power, while the acceleration for Y will be sin(theta) times the engine power.

And theta will be the direction to accelerate in.


Got that far. It's the whole 'How do I calculate theta' that's the problem.

S1x-S2x = (V1x-V2x) * T + ((A1*cos(Theta)) -A2x) * T * T

V1x would be Enemy Velocity X, A1 would be Acceleration Vector Length, Theta would be the angle to accelerate in, A2x would be Target Acceleration X and T would be Time?
What are S1 and S2?

Unknowns are Theta and T, common to both.
You can rearrange the first formula to get Theta = F(T)... there will be inverse cos or inverse sin in it.
Replace the Theta in the second equation with F(T).


What is 'F'?

Now you've got a big horrid, fearsome beasty with only T as an unknown. Solve for T. You'll probably need a big sheet of paper, or maybe maple to simplify it down to a one-line equation to code in.
Now I'm wondering which variation of that formula you gave I should use to figure out T or Theta or whatever it's supposed to give me.
Plus, I think that 'Big sheet of paper' part may put it somewhat outside my mathematical ability.

Plug T into the first formula again, and Solve for Theta.

Your ship/missile can then accelerate in the direction of Theta for time T. (Theta = 0 means the +X direction, 90 degrees = +Y)

Yeah, I may need a bit of help to figure out exactly how to do that.

Going to have to fiddle with the angle, then. C# uses radians for 3d object angles and 0 is +Y (Although I'm using X and Z for horizontal and vertical).

@Jack: That formula you gave me gives Time, right?

I'll go let my brain collapse for a while, then come back and see if I can figure this out. If brute force can figure it out, then I may be able to turtle my way through before my brain starts screaming at me.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
 

Bookmarks


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 On

Forum Jump


All times are GMT -4. The time now is 10:28 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.