About Store Forum Documentation Contact



Post Reply 
Camera over shoulder
Author Message
AndrewBGS Offline
Member

Post: #1
Camera over shoulder
Hi there, I was updating my code from EE1 to EE2, now I have almost everything sorted out, except one tiny detail.

I want to have the camera looking over my character's shoulder, so the crosshair won't target the player but the item to be picked up (like in Elder Scrolls for example).

The code I used is combined with the one form Camera clipping, and I'm using the function Cam.setPosDir(...) to do that.
In order to set it over the shoulder and not in the center, i set the camera at as follows:
desired_camera.at =Players[0].ctrl.center()+head.cross()/2;
After this the ball for camera collision is applied, and the camera is called with setPosDir function.

Now, this is exactly what I had in EE1 and it worked perfectly. Here however, while it does still work, it glitches a lot, looks like skipping a frame once in a while or something like that.

It may not be a big issue, but I can't figure what causes this, and no one will want to play my game with this annoying camera glitch, so if you could help me out, I'd really appreciate it.
(or, if you have alternative solutions for placing camera over the shoulder of the char not in the middle of it's back, I'd appreciate it)
03-28-2013 04:36 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Camera over shoulder
Hi,

That's probably related to EE 2.0 physx3 being processed in background thread making the ctrl.actor to return different value at any moment.
You can try to base camera on character animation skeleton, or store actors position inside character animation function, you can check character source code for setting animation from actor position.
03-30-2013 11:08 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #3
RE: Camera over shoulder
Right, you kinda lost me there, but at least I have a hint to go for.
I'll see what I can manage, thanks smile

Nope, using .cskel.pos() made it even worse.... trying something else.

Ok, I'll have to ask some detail information about that "store actors position inside character animation function", maybe that might help, who knows. I've tried setting the position to every point of player or skeleton i could think of, still ctrl.center() glitches the least.
But it's still annoying... Maybe I'm doing the whole camera over shoulder wrong? Has anyone else got it working?
(This post was last modified: 03-30-2013 11:28 AM by AndrewBGS.)
03-30-2013 11:09 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Camera over shoulder
You can check ERPG2 tutorial from the store, it is compatible with EE 2.0, PhysX 3 and has camera setting from character position.
03-31-2013 09:08 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #5
RE: Camera over shoulder
Ok, I figured my problem eventually. Damn sad, really.
In the gameUpdate function i had worldUpdate after updateCamera. Aparently that was the issue, i changed the order and now it all works fine. I had no idea that amttered, in EE1 it didn't.
03-31-2013 09:44 PM
Find all posts by this user Quote this message in a reply
Post Reply