Maya Spline
From Retro Modding Wiki
A Maya Spline is a 2D hermite curve first introduced in Metroid Prime 2: Echoes. It's used in various file formats to animate some sort of effect over time. It most commonly shows up in MREA files in script object properties, but it can also appear in other formats.
Contents
Format
Structure (Metroid Prime 2/3)
Type | Count | Name | Notes |
---|---|---|---|
u8 | 1 | Pre Infinity | Infinity setting for time ranges before the start time of the spline curve. |
u8 | 1 | Post Infinity | Infinity setting for time ranges after the end time of the spline curve. |
u32 | 1 | Knot Count | Number of knots in the spline. |
Knot | Knot Count | Knot Array | Array of knots forming the actual spline. |
u8 | 1 | Clamp Mode | Clamp mode setting. |
float | 1 | Minimum Amplitude | Minimum amplitude used for clamped splines. |
float | 1 | Maximum Amplitude | Maximum amplitude used for clamped splines. |
Structure (Donkey Kong Country Returns)
Basically the same data as in Prime 2/3, but shifted around slightly.
Type | Count | Name | Notes |
---|---|---|---|
u32 | 1 | Knot Count | Number of knots in the spline. |
Knot | Knot Count | Knot Array | Array of knots forming the actual spline. |
float | 1 | Minimum Amplitude | Minimum amplitude used for clamped splines. |
float | 1 | Maximum Amplitude | Maximum amplitude used for clamped splines. |
u8 | 1 | Pre Infinity | Infinity setting for time ranges before the start time of the spline curve. |
u8 | 1 | Post Infinity | Infinity setting for time ranges after the end time of the spline curve. |
u8 | 1 | Clamp Mode | Clamp mode setting. |
Knot
Offset | Type | Name | Notes |
---|---|---|---|
0x0 | float | Time (X) | Time the knot is placed at; also serves as the knot's X position on the spline. |
0x4 | float | Amplitude (Y) | Amplitude of the knot; also serves as the knot's Y position on the spline. |
0x8 | u8 | Unknown | |
0x9 | u8 | Unknown |
Infinity Type Enum
This file format is almost completely documented Values are unknown but are probably similar to the values on this page. |
Clamp Mode Enum
ID | Mode |
---|---|
0 | Unclamped |
1 | Clamped between min/max |
2 | Unknown |