[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ] [ Search: ]

4.10.19.2 Furmesh Animation

Written by Alexandru - Teodor Voicu, voicualexandruteodor@gmail.com.

Introduction

Furmeshes support a variety of animations, from simple inherited animations, that come from objects on which the furmesh is attached, to complex animations, based on physics objects, such as Bullet ropes.

There are three main interfaces that can be used for animating furmeshes:

Creating Furmesh Animations

Creating both iFurAnimatedMeshControl and iFurPhysicsControl is done via the iFurMeshType interface, using the CreateFurAnimatedMeshControl, respectively the CreateFurPhysicsControl methods.

An example of creating such iFurAnimationControl interfaces is:

 
...  
// Load furMesh
csRef<CS::Mesh::iFurMeshType> furMeshType = 
  csQueryRegistry<CS::Mesh::iFurMeshType> (hairTest->object_reg);
if (!furMeshType)
  return hairTest->ReportError("Failed to locate CS::Mesh::iFurMeshType plugin!");
...  
// Create Hair Physics Control
hairPhysicsControl = scfQueryInterface<CS::Mesh::iFurPhysicsControl>
  (furMeshType->CreateFurPhysicsControl("krystal_hairs_physics"));
// Set up Hair Physics Control
hairPhysicsControl->SetBulletDynamicSystem(hairTest->bulletDynamicSystem);
hairPhysicsControl->SetRigidBody(headBody);
hairPhysicsControl->SetAnimatedMesh(animesh);
...
// Create Animation Physics Control    
animationPhysicsControl = scfQueryInterface<CS::Mesh::iFurAnimatedMeshControl>
  (furMeshType->CreateFurAnimatedMeshControl("krystal_hairs_animation"));
// Set Animation Physics Control    
animationPhysicsControl->SetAnimatedMesh(animesh);
animationPhysicsControl->SetDisplacement(ifms->GetDisplacement());
...
// Regiseter Animation Control with the furmesh
furMesh->SetAnimationControl(animationPhysicsControl);
furMesh->StartAnimationControl();
...

This document was generated using texi2html 1.76.