1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 12:19:55 +00:00
Commit graph

120 commits

Author SHA1 Message Date
Chris Robinson
1399a06c76 Update animation looping when setting the same state 2013-02-19 04:01:33 -08:00
Chris Robinson
ff0099fa6e Scale the animation speed based on the animation velocity and movement speed
This may not be totoally correct since it takes the whole animation into
account, rather than just the looping portion. But it's good enough for now.
2013-02-15 02:15:39 -08:00
Chris Robinson
4ee5857bae Filter accumulation axis for mLastPosition as needed 2013-02-09 19:09:56 -08:00
Chris Robinson
8d6f017f17 Remove an unneeded Animation field 2013-02-09 13:25:39 -08:00
Chris Robinson
18b7008409 Better fix some scaling issues 2013-02-05 18:25:09 -08:00
Chris Robinson
8b1e7b95ba Attempt to load the skeleton source if it doesn't yet exist 2013-02-05 17:55:12 -08:00
Chris Robinson
054ef3113a Check existing skeleton sources if the current one has no animation root 2013-02-05 17:15:40 -08:00
Chris Robinson
16933e3926 Scale the accumulation root translation 2013-02-05 16:59:20 -08:00
Chris Robinson
600fe06f00 Use a vector of skeletons to handle animation sources 2013-02-05 16:29:51 -08:00
Chris Robinson
23acf4b130 Don't break right away when the animation time remaining is 0 2013-02-03 01:38:42 -08:00
Chris Robinson
fc7590694d Revert "Revert "Use a child scene node for the accumulation root""
This reverts commit 376dfed15b.

I was wrong. It's needed at least for NPCs since they're attaching multiple
animated skeletons to an object, and they all need to be offset correctly.

Would be nice to use a Node, Bone, or TagPoint instead of a hefty SceneNode,
though.
2013-02-02 05:43:37 -08:00
Chris Robinson
376dfed15b Revert "Use a child scene node for the accumulation root"
This reverts commit d6f923f274.

We don't need it for any of the NIFs we're currently handling. As long as
there's no NIF files that would break it, we should require a stationary root
if an animation wants to accumulate. If we must, a better idea may be to inject
an extra bone into the skeleton instance and make that the accumulation root.
2013-02-01 08:50:32 -08:00
Chris Robinson
d6f923f274 Use a child scene node for the accumulation root 2013-01-30 22:28:18 -08:00
Chris Robinson
b6354c6282 Don't share skeleton instances between bounded parts on an NPC
However, a skeleton instance will still be shared between entities in an entity
list.
2013-01-30 09:29:16 -08:00
Chris Robinson
5c3a7f7d52 Avoid handling animation states
We don't need them anymore
2013-01-30 07:34:07 -08:00
Chris Robinson
360f7bfac8 Apply animations to bones manually
Couple reasons for this:

* This paves the way for allowing animations specified in other skeletons to
be applied to the character (NPCs and certain creatures can have multiple
animation sources, but Ogre is incredibly strict when it comes to sharing
animations between skeletons).

* It will allow for entities to be animated based on the character's skeleton,
without having to duplicate the mesh for each skeleton it can be used on.

This doesn't impact Ogre's ability to efficiently deform skinned meshes, nor
does it get in the way of hardware skinning.
2013-01-30 07:04:18 -08:00
Chris Robinson
99efe4e494 Remove an unnecessary class member 2013-01-29 01:02:55 -08:00
Chris Robinson
879359f39d Set the animation state loop flag as appropriate 2013-01-29 00:50:52 -08:00
Chris Robinson
92d0c55f32 Add a flag to specify if an animation should be playing 2013-01-29 00:43:42 -08:00
Chris Robinson
7df4d0d19f Remove an unnecessary cast 2013-01-28 21:41:51 -08:00
Chris Robinson
b1ffdf855f Reset the initial state of animated nodes on the skeleton instances
This is so the animation specifies node keyframe data based on the node's
parent. This will also be necessary for applying animations from different
skeleton sources, as they can have different binding positions (even native
.skeleton resources will need to specify animation data this way).
2013-01-26 04:48:53 -08:00
Chris Robinson
05f8b8c283 Specify the text key to reset animations to 2013-01-22 00:31:45 -08:00
Chris Robinson
37fe1bd3f0 Handle looping in the Animation object 2013-01-21 22:51:13 -08:00
Chris Robinson
536f8104e6 Do not create an 'all' animation. 2013-01-20 17:24:43 -08:00
Chris Robinson
e1e76bde76 Combine a loop into another where it's used 2013-01-20 15:39:43 -08:00
Chris Robinson
85ca1e993f Properly check if an animation exists before playing it 2013-01-19 21:55:04 -08:00
Chris Robinson
0b68953f0d Scale animation speed using the direction length
The direction length doesn't currently give a good speed, but it's something.
2013-01-18 21:40:47 -08:00
Chris Robinson
1cdd64cd9b Return the animation movement from the character controller.
Consequently, dead actors don't move anymore. The doPhysics call apparently
isn't moving them.
2013-01-18 17:05:58 -08:00
Chris Robinson
9123f4f2af Return the movement vector from runAnimation 2013-01-18 16:21:29 -08:00
Chris Robinson
c7684cb979 Pass the key time to markerEvent 2013-01-18 14:50:55 -08:00
Chris Robinson
3e9b0a333c Allow specifying the accumulation for animations
Animations that move a character may do so either visually or physically. An
axis' accumuluation value specifies whether the movement is visual (0) or
physical (1). Idle animations, for instance, typically don't physically move a
character, while death animations may physically move them along the X and Y
planes, but not along Z (the vertical movement is purely visual).
2013-01-18 14:25:32 -08:00
Chris Robinson
fef6284f15 Only reset the animation time if a new state was set 2013-01-17 15:47:25 -08:00
Chris Robinson
fc0f9e2159 The animation state tracks the animation time for us 2013-01-17 14:49:42 -08:00
Chris Robinson
7cce44290e Handle the animation queue in mwmechanics 2013-01-17 13:18:40 -08:00
Chris Robinson
82d549e22f Don't update the animation if time is the same 2013-01-16 21:39:14 -08:00
Chris Robinson
7ee389f3b2 Handle animation skipping in the character controller 2013-01-16 21:25:50 -08:00
Chris Robinson
852aa214cc Store the available animation names in the character controller 2013-01-16 21:16:22 -08:00
Chris Robinson
4dd01b81c6 Update mTime when updating or reseting the animation, and refactor the animation loop 2013-01-16 20:14:49 -08:00
Chris Robinson
3c32385e17 Avoid trying to animate things that don't have animations 2013-01-16 15:00:06 -08:00
Chris Robinson
94b93227d3 Treat activators as actors for rendering and mechanics
Kinda hacky, but it's the only way to get animated activators (flags, silt
striders, etc) to work properly.
2013-01-16 14:37:32 -08:00
Chris Robinson
d2fc3c7b33 Add a method to tell the character controller of new text keys 2013-01-16 13:09:21 -08:00
Chris Robinson
0a2f92f679 Keep track of the current text key in the animation 2013-01-16 11:57:08 -08:00
Chris Robinson
f46587c383 Store an character controller in the animation 2013-01-16 11:01:08 -08:00
Chris Robinson
c4c8295e0b Rename NIFLoader to Loader, and update some comments 2013-01-09 09:10:59 -08:00
Chris Robinson
1e38e381a4 Use text keys for each animation 2013-01-09 03:30:55 -08:00
Chris Robinson
bb98542c5a Build separate animations for each group 2013-01-09 01:40:38 -08:00
Chris Robinson
e44729cd43 Make the text keys lower-case when extracting them
I think it's safe to assume all text keys are treated in a case-insensitive
manner. So far the only known NiTextKeyExtraData records are for animation
keys, which effectively are.
2013-01-09 00:17:42 -08:00
Chris Robinson
2a9dc5ad94 Ensure mCurGroup always has valid iterators, and only get the animation state when animation keys exist 2013-01-07 21:00:21 -08:00
Chris Robinson
d8dbd5e206 Store text key iterators for the start and stop times 2013-01-07 05:56:03 -08:00
Chris Robinson
d3e949f5c6 Make the animation text keys lower case to help lookup 2013-01-07 05:23:44 -08:00