Game Development Community

Why can't the control object be told to "look up/down"?

by Nicolai Dutka · in Torque Game Engine Advanced · 07/28/2008 (4:06 pm) · 3 replies

This has caused me problems MANY times and I am sick of it. I have code that tells a player to look at an object, but it only makes the player yaw and NOT pitch. If I use the exact same code on ANY other object in the entire game, it works perfectly. If I switch the control object to ANYTHING else, then tell the original control object to look up, IT WILL!!

So why can't we make the control object look up/down through code? This is EXTREMELY irritating!!!

#1
08/09/2008 (12:36 pm)
The player's pitch isn't actually set by modifying its rotation. Players can only rotate on yaw (they are always standing upright). You'll need to modify mHead.x from within the Player class. I'm not sure if there are any console functions to modify this value, but they'd be easy enough to add.

Also, nothing personal, but you'll get better responses with a slightly less uh.. urgent and pissed off tone. The people in this forum aren't responsible for your coding problems, and acting like they are isn't likely in speed up the response time.
#2
08/09/2008 (1:17 pm)
Nicolai, optimizing code and design can lead to less readable code. That's the case with many areas of the Player class. You're not alone in complaining about that, however, would you rather have unoptimized code?

I wouldn't. And an engine designer can't please both camps at the same time. This isn't answering your question directly, but rest assured if you spend some time and don't expect it all to make sense immediatly, you'll get there. Trust me.
#3
08/10/2008 (8:02 am)
To rotate the whole player, update it's transform (and render transform).
To rotate the head, update 'headvec'.

Many degrees, little knowledge.