-
Notifications
You must be signed in to change notification settings - Fork 0
X‐Wing Alliance OPT format considerations
The convention in the editing tools is a left-handed coordinate system:
- Forward = -Y
- Up = +Z
- Right = +X
This is different from the usual convention (right-handed) used by Blender where +X = Left (when looking in the forward direction).
The vanilla XWA supports rotation based on the mesh type:
- sFoils
- Rotary Turrets
In XwaOptEditor, the Axes are represented like this:
- Red = Rotation (previously known as Look)
- Corresponds to the axis around which the meshes rotate.
- Green = Direction (previously known as Up)
- Represents the "forward" direction for the turrets.
- It should be orthogonal to the Rotation axis.
- Blue = Up Axis (previously known as Right)
- I believe it should always be orthogonal to the other 2 so that the constructed rotation matrix is a pure rotation and does not affect the shape or position of the mesh.
Apart from the axes, you have:
- Pivot: the location in space (3 coordinate point) of the Rotation axis.
- Angle: maximum rotation from the default (attack configuration) when sFoils are Closed (landing configuration).
- A positive angle will rotate the mesh clockwise when looking in the direction of the Rotation axis.
- Closing Speed
- Opening Speed
In JeremyaFr's words:
From the game engine pov the first speed increases the mesh angle and the second speed decreases the mesh angle. The meaning of the values depends on the sfoils type.
For the sfoils the initial state is opened then they can be closed. When the angle increases the sfoil is closing. So the meaning is "closing speed" and "opening speed".
For the landing gears the initial state is closed then they can be opened. When the angle increases the gear is opening. So the meaning is "opening speed" and "closing speed".
This rotation applies to Meshes of Type RotaryWing. They will open or close when the corresponding key is pressed (V).
For the SFoils the game only uses the Rotation axis. The Direction and third axis are ignored.
When the Pivot point is non-zero on a mesh of type Bridge, the mesh stays in place and the rest of the ship rotates around it. For example, in the B-Wing.
The mesh will rotate to point to its target. This rotation applies to meshes of type RotaryGunTurret.
The game will rotate the mesh around the Rotation axis, and the Direction axis is used to identify what part of the mesh needs to point to its current target. This means Direction should point in the direction the turret normally shoots.
When Pivot = (0,0,0), the rotation matrix becomes a scaling matrix with a factor of cos(angle). This behaviour can be used, like in the Imperial Neb-B Frigate hatch doors.
Thanks to the sfoils hook (Readme.txt) by Jeremy, it is possible to animate any arbitrary mesh, not only the ones supported by the vanilla game engine.
The configuration of the sfoils is defined in an .ini file like described in the Readme linked above.
More info and the history of the hook here: https://forums.xwaupgrade.com/viewtopic.php?t=11693
You can have multiple engine glows associated to a mesh of type Engine. Each engine glow is represented by a cone whose position and angle are also determined by 3 vectors.
- Look
- Determines the direction of the cone.
- Up and Right
- They are used to form the transformation matrix for the cone.
- Effectively, they can be used to skew or shear the cone, so that the Look (axis between center of the base and the tip) and the base plane of the cone are not perpendicular. Normally the base of the cone should be aligned with the engine nozzle, and an arbitrary Look direction can suggest a "vectorized thrust" in a non-perpendicular direction of the nozzle.
- Also, the ratio between the length of those 2 axes/vectors can impact the shape of the cone. If the the vectors are not normalized and ratio is not 1:1, the base of the cone will be deformed into an oval shape. This is just a mathematical result of the transformation matrix construction, and not intended. To modify the roundness of the cone use the Dimensions instead.
- If the Up and Right axes are not orthogonal, the resulting matrix will modify the matrix in hard to predict ways.
The engine glows have also additional parameters:
- Color (inner and outer)
- Dimensions: cone width, height, length