odyeiop
01-03-2007 04:19:00
I'm having problems orienting a RayCaster to the playerview in my game and was wondering if there is a way in debug that I can make it visible to see how it is oriented.
If not, perhaps you can help me with what I'm doing wrong in code.
- I have a Player class
- Inside the player is an Entity for the mesh, and a bp<character> for the Nx collision
- The Entity is attached to the same node as the NxCollision
- I go through the skeleton of the entity, and attach a camera to a bone in the head of the character (the character view).
- I use the orientation of the bone to set the direction of the raycaster
- the collision yaws side to side for the player view X
- the bone pitches up and down (with restrictions) for the player view Y
Sorry for all the newbishness lately, I've been trying to wrap this game up. When it's all done I'll make sure to post pics and (if I can) a video.
If not, perhaps you can help me with what I'm doing wrong in code.
- I have a Player class
- Inside the player is an Entity for the mesh, and a bp<character> for the Nx collision
- The Entity is attached to the same node as the NxCollision
- I go through the skeleton of the entity, and attach a camera to a bone in the head of the character (the character view).
- I use the orientation of the bone to set the direction of the raycaster
- the collision yaws side to side for the player view X
- the bone pitches up and down (with restrictions) for the player view Y
orient = player->getGCEntity()->getSkeleton()->getBone("ART_STICK_BONE_CAMERA")->getOrientation();
_dir = orient * Vector3(0,0,1);
_ori = player->getPlayerCollision()->mNode->getPosition();
mCaster->setOrigin(_ori);
mCaster->setDirection(_dir);
Sorry for all the newbishness lately, I've been trying to wrap this game up. When it's all done I'll make sure to post pics and (if I can) a video.