-
Notifications
You must be signed in to change notification settings - Fork 15
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
Feature: Animation changes #95
Feature: Animation changes #95
Conversation
Recent versions of three use an animation system that fits better with how WoW stores animation data. It's still helpful to split animation tracks apart, but it's no longer necessary to create keyframe objects for each individual keyframe.
Newer versions of three can work directly with arrays of values, including for complex types like vectors and quaternions. Since parsing dense content like animations into full-blown objects is rather overkill, we can now start to move away from that approach.
@@ -0,0 +1,15 @@ | |||
import r from 'restructure'; | |||
|
|||
class Color16 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd probably be okay to call this something like SignedFixed16
and read from the stream as an int16le
rather than uint16le
, but I find it weird to do that for values that can't be negative (like transparency and color values).
Hence... Color16
-- your one-stop shop for values between 0.0 and 1.0 stored as shorts with values between 0 and 32767.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This PR will break Wowser until wowserhq/wowser#145 is merged. |
@@ -0,0 +1,3 @@ | |||
import r from 'restructure'; | |||
|
|||
export default new r.Array(r.floatle, 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the same as float3
? I'd be totally in favour of normalizing all of these to make things more clear 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thought was that we should have a consistent naming scheme, and float3
would conflict with things like float16
(for a single fixed-point 16-bit float).
Since float3
is a vector made up of 32-bit floats, I thought maybe we should move toward vec3float32
as a more consistent name.
If you're cool with that, I can search and replace all float3
s to vec3float32
s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sounds perfect 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would we differentiate between an array of three float values – currently float3
, vec3float32
– and an object with x, y, z properties – currently Vec3Float
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recap from Gitter: array types now use <type>array<len>
as a naming convention, like so:
float32array3 -> [1, 2, 3]
This should resolve naming confusion with types that involve named properties.
* Removed all uses of float2 and float3 * Renamed array vector types to <type>array<len> convention
🎉 Awesome! |
three's new animation system makes it quite a bit easier to work with the data present in M2 animations. This PR brings Blizzardry more in line with what three expects, and produces somewhat leaner output-- particularly when serializing and deserializing.