Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

splineblock: not all control points are extracted #4

Open
JayFoxRox opened this issue Nov 25, 2017 · 2 comments
Open

splineblock: not all control points are extracted #4

JayFoxRox opened this issue Nov 25, 2017 · 2 comments

Comments

@JayFoxRox
Copy link
Member

The spline tool should export more info. Currently only a part of the actual spline information is shown.
Maybe it makes sense to just export a blender python script to generate blender splines. I think OBJ might be too limited.
Collada output could also be an option.

@JayFoxRox
Copy link
Member Author

I've started RE here, so we can understand all fields

@JayFoxRox
Copy link
Member Author

I have an okay grasp of this now.

  • Each spline point has 1 position and 2 control points (one in the "next" direction, one in the "prev" direction)
  • Each spline point has up to 2 "next" points, and up to 4 (- only 3 are used) "prev" points (for diversions)
    • There is 1 control point index, which should be used for the "prev" points
    • There are 8 (? - only 2 are used) control point indices which should be used for the "next" points. The number of used control points seems to match the number of "next" points.

So I assume that these are cubic bezier curves.
The connection probably looks something like this:

# x = the next point we want to connect
this = spline[first_index]
P_0 = this.pos
P_1 = spline[this.next_control_point_indices[x]].next_control_point
P_2 = spline[this.prev_control_point_index].prev_control_point
P_3 = spline[this.next_point_indices[x]].pos

Note that all of this is based on assumptions, not RE of the games code!
I'm very unsure about how all these indices are are used.
The data structure is documented (unconfirmed) in JayFoxRox#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant