Maya Spline: Difference between revisions

From Retro Modding Wiki
Jump to navigation Jump to search
>Aruki
>Aruki
 
Line 5: Line 5:
== Format ==
== Format ==


=== Structure (Metroid Prime 2/3) ===
=== Structure ===
 
==== Metroid Prime 2/3 ====


{| class="wikitable"
{| class="wikitable"
Line 49: Line 51:
|}
|}


=== Structure (Donkey Kong Country Returns) ===
==== Donkey Kong Country Returns ====


Basically the same data as in Prime 2/3, but shifted around slightly.
Basically the same data as in Prime 2/3, but shifted around slightly.

Latest revision as of 19:00, 3 March 2017

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.

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.

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