Animating simple objects

Animating simple objects

Hi, I am just beginning with Havok and I have a very nooby question: How do you animate simple objects using Havok animation? I followed the tutorials for skeleton animation, but I'm not sure how to do anything else. An example of what I want to do would be: On frame 10 of an animation, a rigid body box appears over the head of the character (keyframed, not physics). It moves around in a little circle and then disappears on frame 60 of the animation. It is not attached to any bones. How would I do this and be able to export and use it in my application?By the way I am doing my editing in Maya and would like to create/animate this function within Maya if possible

3 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
Best Reply

Hi fiction:
I think you want to output a keyframe animation by using Havok Content tools. Havok Animation is kinds of a skeleton base animation system, you need at least one bone for one track even you do not need a bone for it. So, you can output a very simple single bone animation, and then use it to drive your rigid body in the code.
I did a test in 3DMax. (I am not so familar with Maya, but all Havok Content Tools part should be the same.)I created a box001 in a scene and made a very simple animation to move it from right to left (X Axis) within 25 frames. And then I am going to use Havok Content Tools to export it. Followed with the list of the filter in order which I used.
Transform SceneCreate Skeletons( Select "Manual" in Build Rig section, and then in Bones section, add "Box001" into the Rig Bones list)Create Animations( Click "Frame range", and set it from 0 to 25; select "Manual" in Animation Tracks section; in Bones section, add "Box001" into Bone Tracks list)Preview ToolPrune Types( Click "All Scene Data" and "Skeletons")Write to PlatformView XML
If you check the XML. there will be something like

	
	
	HK_INTERLEAVED_ANIMATION
	0.833333
	1
	0
	null
	
		
			Box001
			
		
	
	
		(0.000000 0.000000 0.000000)(0.000000 0.000000 0.000000 1.000000)(1.000000 1.000000 1.000000)
		(-0.014495 0.000000 0.000000)(0.000000 0.000000 0.000000 1.000000)(1.000000 1.000000 1.000000)
		(-0.056392 0.000000 0.000000)(0.000000 0.000000 0.000000 1.000000)(1.000000 1.000000 1.000000)
		(-0.123309 0.000000 0.000000)(0.000000 0.000000 0.000000 1.000000)(1.000000 1.000000 1.000000)
...

So you actually exported a hkaInterleavedUncompressedAnimation, 1 tracks , 26 frames , named Box001.
On the code side, you can load this animation in normal way, and then use hkaAnimation::sampleSingleTransformTrack(...) interface to sample this animation, finally use hkpKeyFrameUtility::applyHardKeyFrame(...) to drive your keyframed rigid body.
Quite straight forward, hope it can help you. 

Joe
Developer Support Engineer
Havok
www.havok.com

Excellent answer. Thank you very much! :)

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!