Jump to content

Parent Entity Screwing Up Entity Rotation


Shard
 Share

Recommended Posts

So I am trying to parent the camera to my characters head for a first person view. Of course I go ahead and find the child head and create a mesh for it and all that.

 

When I go to parent the camera to the head, the camera get tilted into one side. When I comment out the parenting, then its just fine.

 

//Parenting and Not Working

EntityParent(frameWerk->GetMain().GetCamera(),head);

 

Not much more to it than that.

I even tried getting the camera rotation before parenting and then setting it back to that rotation but that didn't work.

 

//Recording, Parenting and Resetting

TVec3 rot = EntityRotation(frameWerk->GetMain().GetCamera());
EntityParent(frameWerk->GetMain().GetCamera(),head);
RotateEntity(frameWerk->GetMain().GetCamera(), rot);

 

 

 

What should I do to fix this?

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

Use SetEntityMatrix/GetEntityMatrix instead of parenting. Parenting has lots of problems where positioning always works fine.

 

No luck. Same effect. Even tried a manual get/set pos and get/set rotation. No luck.

 

Also, see the related thread here: http://leadwerks.com/werkspace/index.php?/topic/1927-find-child-entity-matrix-all-messed-up-bug/

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

It sounds like your animation make the bone oriented in a way you did not intend. If you can post a demo showing your problem, someone can probably help you.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

It sounds like your animation make the bone oriented in a way you did not intend. If you can post a demo showing your problem, someone can probably help you.

 

This happens even before I start the animation. As for a demo, I'm going off of the Animation tutorial directly.

simpleSigPNG.png

 

Programmer/Engineer/Student

www.reikumar.com

 

2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM

C++ - Visual Studio Express - Dark GDK - Leadwerks SDK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...