@SalatalikTursusu et al --
All right, it was without a doubt my implementation -- a combination of mixing conventions and trying to do too much within the interactive rotation code.
So, I had to take a step back and reorganize things a little bit, tweak some things and in general remove all the *HACKS* I had put in place. It’s my own fault and I know better but that’s what you get when you are in a rush to get things done and don't take the time to think things through.
Anyhow -- I've updated the code base and things look much better than they did but I would ask for some assistant in testing it. You can find the code only update
hereSome items that have changed include:
Action MappingsInteractive Mode A – Move forward
Z – Move backwards
+ – Accelerate movement
- – Decelerate movement
I – Pitch up
M – Pitch Down
J – Yaw Left
K – Yaw Right
U – Roll Left
O – Roll right
Strategy Mode W - issue move orders (M key was conflicting with the above)
2. Rotation methods where moved into the GameObject base class.
3. New GameObject members include:
Public PropertiesDepth - Represents the depth of the model's bounding box.
Height -Represents the height of the model's bounding box.
Orientation - Model Orientation Quaternion.
OrientationMode - Represents the orientation mode of the model.
Width - Represents the width of the model's bounding box.
Public MethodsConvertOrientation - Overloaded. Converts the model's _Orientation field to a D3DMatrix.
*OR* Converts the specified Quaternion to a D3DMatrix.
GetOrientation - Returns a Quaternion representation of the models D3D Matrix.
GetSize -Extracts the values for Height, Width and Depth from the bounding box information.
Rotate - Overloaded. Used to orient the GameObject using the supplied axis and angle.
*OR* Used to orient the GameObject to the supplied vector.
SetRotation - Sets the model rotation based on the supplied Quaternion.
Public EventsOrientationChanged - Occurs when the models orientation has changed.
OrientationModeChanged - Occurs when the models orientation mode has changed.
Note: PositionChange event event handler was renamed to GameObjectMovementEventHandler
Protected Fields_Orientation - Quaternion which represents the objects current orientation.
_RotationDestination - Quaternion which represents the target orientation.
_RotationOrigin - Quaternion which represents the objects origin orientation.
Protected MethodsOnOrientationChanged - Raises the OrientationChanged event.
OnOrientationModeChanged - Raises the OrientationModeChanged event.
------
Other important notes:
The interactive rotation code has been removed from the Starship.Instance_FrameStart event handler entirely. The interactive rotation is handled via the Starship.Instance_KeyDown event handler Interactive movement check region of code. Which essentially evaluates the keyboard input and applies the rotation (via GameObject.Rotate method) to the model's orientation immediately based on the appropriate action mapping.
As always I’ll be happy to field any question regarding the implementation.
-War