Hi Guys!
I have a mesh (a dog) I want to move it around the space
the mesh with collision detection system and I want to place the camera on the
head of the mesh, this is my code:
I create a collider called collider_dog:* csRef<iMeshWrapper> mesh_dog = engine->FindMeshObject("dog_lib");
collider_dog.SetCollideSystem (cdsys);
collider_dog.SetEngine (engine);
csVector3 legs_dog (0.2f, 1.7f, 0.2f);
csVector3 body_dog (0.2f, 2.2f, 0.2f);
csVector3 shift_dog (0, -1.7f, 0);
collider_dog.InitializeColliders ( mesh_dog, legs_dog, body_dog, shift_dog);
collider_dog.SetCD(true);
on
ProcessFrame() I do:*ProcessFrame(){
[.....]
if(UPKey_isPressed){
view_dog->GetCamera ()->Move ( 0.01f * CS_VEC_FORWARD,true);
csRef<iMeshWrapper> mesh = engine->FindMeshObject("dog_lib");
collider_dog.Move ( float (elapsed_time) / 1000.0f, 1.0f, csVector3(0,0,1), 0 );
csVector3 rot = collider_dog.GetRotation ();
float radian = 0.0174532925f;
float angle = (rot.y*365)/6.0f;
float y = view_dog->GetCamera()->GetTransform().GetOrigin().y;
mesh->GetMovable()->SetPosition( csVector3( mesh->GetMovable()->GetPosition().x + (float)sin(angle*radian) * 0.05f,
y,
mesh->GetMovable()->GetPosition().z + (float)cos(angle*radian) * 0.05f ) );
mesh->GetMovable()->UpdateMove();
}
// place the camera on the head of the mesh
csRef<iMeshWrapper> mesh = engine->FindMeshObject("dog_lib");
csOrthoTransform transform = bone_dog->GetFullTransform()*mesh->GetMovable()->GetFullTransform();
transform.RotateThis( csXRotMatrix3 (PI)*csYRotMatrix3 (PI) ) ;
view->GetCamera()->SetTransform( transform );
collider_dog.Move ( float (elapsed_time) / 1000.0f, 1.0f, 0, 0 );
[...]
}*
*OK, the result is that mesh is moving but the y axis is ignored
and seem to be always on a fixed value...
What is wrong?

This problem drive me crazy!



Thanks....