Game Development Community

RenderFirstPerson for shapeBasedImages?

by Benjamin Schneider · in Torque Game Engine · 03/29/2007 (8:09 am) · 7 replies

Hi all,

I initially posted this in the engine section and later realized that wasn't the proper place for it.

I've searched the forums for this but so far haven't been able to find a definitive answer. Is there something similar to renderFirstPerson = false for mounted shapeBaseImages?

I'm working on a firefighting game and the self contained breathing apparatus (SCBA) is basically a facemask. To my knowledge, I can't just have this be part of the firefighter model as the firefighter needs to be able to take the SCBA on and off depending on the situation, so the player's renderFirstPerson state won't do.

I've mounted the SCBA with no problems. From a detached camera, it is aligned perfectly and looks quite good. In first person perspective, however, when you look up or down, you can see the frame of the SCBA - it obstructs the eye node view.

I'm aware of the eyenode offset but I'd really prefer not to have the player's eye change positions when they put on the SCBA.

Thanks for any guidance,

Ben

#1
03/29/2007 (8:27 am)
No such function exists by default.

Why not just adjust the eyeOffset and the eyeRotation of the SCBA (image) until it no longer obstructs the player's view? This will only affect first person positioning and not third person, which sounds perfect for your needs.
#2
03/29/2007 (10:32 am)
Sounds like the node it's mounted to isn't moving with the look up and down animations. So I assume you are going to have to do some additional work to the player model to get that to happen. Also you can do what Tim suggests and mess with the image offsets in the datablock.
#3
03/29/2007 (10:57 am)
Hi guys,

Thanks for the suggestions.

@Tim: I've tried offsetting the eyeNode so it is outside the SCBA, but when I do, I'm outside of my bounding box as well so my eyeNode can see through walls. I can't afford to increase my bounding box size because I'm really building a sim rather than a game, so real-world door sizes, etc. are important.

@Zod: The mount node is a child or my head joint and is animating with any head rotations, etc. The movement code in Player.cc, however, uses its own procedure to move the eye node's rotation so when you look up, down, right and left, it isn't calling any animation threads but instead just rotates the eyeNode. I'm thinking I could break that implementation and keep the eyeNode's rotation locked to the rotation of the head joint at all times. Of course, this leads me to another question. Is it possible to do blend animations with DTS objects that only affect part of the joint structure? Maybe that's not stated clearly. I guess I'm trying to avoid having to have a sequence for all the possibilities: rootLookForward, rootLookUp, rootLookDown, rootLookLeft, rootLookRight, runForwardLookForward, runForwardLookUp... and so on... It'd be great if I could keep my root, runForward, etc. sequences and add lookUp, lookDown, lookLeft, lookRight, etc. Do you know if this is possible with DTS?

Also, for both of you - or anyone else, if anything I've said is just plain wrong, don't hesitate to correct me.

Any other options? Skinning? How difficult would it be for me to make two variants of my mesh (one with SCBA and one without) and swap them? I have to keep in mind that each player needs to be able to "put on and take off" the SCBA at will, so I don't think I can do this via the datablock. My understanding is that modifying the datablock will change the state for all players using that block. Am I correct about this?

Thanks a bunch,

Ben
#4
03/29/2007 (4:34 pm)
You wouldn't modify the datablock in this case. You would simply have 2. One with the mask and one without. Then switch the datablocks with the setDatablock() function call.

As for the animations, I am not sure but I think you can do what you are asking. You will have to find a Torque modeler god somewhere to confirm and explain. I am a lowly modder :)
#5
03/29/2007 (6:38 pm)
I'm not talking about the eyeNode or anything to do with the player.

I'm talking about the eyeOffset which will move the SCBA Image within the first person view.
#6
03/29/2007 (9:14 pm)
Oh! I didn't realize that's what the eyeOffset did. I thought it transformed the player's eyeNode by that offset. Sweet! Thanks Tim.

Thanks too Zod for the setDatablock() suggestion. That will definitely come in handy.

Ben
#7
12/27/2007 (11:23 pm)
How can I create my own first person camera?, without eye node
BECAUSE my model eye node is in bad position
I have 'only' a DTS model but I can't manipulate eye node, what can i do?
how can I modify the eye position using a script? iS IT POSIBLE?'
OR What can i do?


and.... Somebody know why renderFirstPerson = false; does't work on TGEA?