Jump to content

help about kOS


veggero

Recommended Posts

Answer to (1):

What do you think x and z are? Do you mean relative to the universe's axes? I assume not because that's just the :X and :Z components of the velocity vector SHIP:VELOCITY:ORBIT (or SHIP:VELOCITY:SURFACE, depending on which you wanted), which would be too easy of an answer.

I suspect you mean relative to your ship's facing - as in the fore direction and the starboard direction.

If that's the case, then you can get that with dot products of the vector with the ship's current facing axis vectors:

SET STARBOARD_VEL TO VDOT( SHIP:FACING:STARVECTOR, SHIP:VELOCITY:ORBIT).

SET FORE_VEL TO VDOT( SHIP:FACING:FOREVECTOR, SHIP:VELOCITY:ORBIT).

Answer to (2):

As a vector:

SET ANTI_TARGET_VECTOR TO (-1) * TARGET:POSITION:NORMALIZED.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...