Looking into to moving on to jme3 have some questions though
can a method be added to chasecam to allow for “free” looking, or is there a reason its not supported (in case I’m not clear being able to look around without using the modifier key)
also need to have the character follow the camera z direction, I would imagine its similar…in theory to what I did in jme2 see bellow…anything else I should consider or should do it differently
[java] if(mouseRotating = true && followObject != null)
{
Vector3f v = new Vector3f( followObject.getWorldTranslation().x,
followObject.getWorldTranslation().y,
followObject.getWorldTranslation().z );
v.addLocal( camera.getDirection().x, 0f ,camera.getDirection().z );
followObject.lookAt( v , Vector3f.UNIT_Y );
/Quaternion newRot = new Quaternion();
newRot.lookAt(new Vector3f(camera.getDirection().x,0,camera.getDirection().z), Vector3f.UNIT_Y);
followObject.getLocalRotation().set(newRot);/
//followObject.updateWorldVectors();
}[/java]
thanks in advance
The chase cam is very new and we are still thinking about how to implement it the damping method of jME2 was a bit error prone and in Ardor its really just “workaround-fixed” from what I saw last time… So its still todo. Any good ideas?
normen said:
The chase cam is very new and we are still thinking about how to implement it the damping method of jME2 was a bit error prone and in Ardor its really just "workaround-fixed" from what I saw last time.. So its still todo. Any good ideas?
not really, all the alternatives I know are jme2 the wonky third-person controller in jme2 is the reason I "fashioned" one out of Lex's strategic handler and that works well and offered me a few unexpected, but welcomed bonuses e.g easily getting float values for camera pitch and yaw....used that to distinguish head/body/leg attacks ..........but that's besides the point, really need a workable third person solution to switch, don't have the skill to build one from scratch :(.............................the reason I'm thinking of switching as an md5 animation bug, I can't seem to get rid off, plus the lack anim channels in that mean I'm gonna have to double, triple or worse my animation work to get my idea to work as expected and what I thought up is still untested .......little free time:(
mcbeth said:
can a method be added to chasecam to allow for "free" looking, or is there a reason its not supported (in case I'm not clear being able to look around without using the modifier key)
I'm not sure to understand, you want to be able to rotate the camera around the target without clicking on the mouse button?
If that's it, i guess i can add a clickToDrag boolean like it's done for the flyby camera.
There is no real reason it's not supported, i'm open to suggestions. I made the cam from scratch, and i don't have a clue of how it worked in JME2.
Another thing, you can have a "look around" behavior when you zoom in to the max.
nehon said:
I'm not sure to understand, you want to be able to rotate the camera around the target without clicking on the mouse button?
yes
If that's it, i guess i can add a clickToDrag boolean like it's done for the flyby camera.
that would be most appreciated, thanks
There is no real reason it's not supported, i'm open to suggestions. I made the cam from scratch, and i don't have a clue of how it worked in JME2.
the one in jme2 had serious issues , especially if you wanted a setup like Max Payne....which is what I'm going for, hence the reason I extended the strategic handler......................hell I want to add an RTS element/ overhead view to my second project so I may try porting it anyways but I am not that good so...........
Another thing, you can have a "look around" behavior when you zoom in to the max.
yeah but that takes u into what is pretty much first person
mcbeth said:
If that’s it, i guess i can add a clickToDrag boolean like it’s done for the flyby camera.
that would be most appreciated, thanks
Ok, i'm on it. Besides it's consistent with the flyby camera behavior.
mcbeth said:
Another thing, you can have a “look around” behavior when you zoom in to the max.
yeah but that takes u into what is pretty much first person
yhea i made the camera before i got into the core team, and that was my need at the time, and i didn't think it could be integrated in the core.
This can be convenient though...
But i don't think there is a camera implementation that fits every needs, i guess most of the time, developers will have to extend the camera to fits their particular needs.
cool thanks could you also add an option to rotate the player to look down the the camera’s z direction
I don’t think it’s a good idea, the camera should not move nor rotate the target to keep things independent.
It’s easily doable externally, like you did in the piece of code you wrote in your first post.
nehon said:
I don't think it's a good idea, the camera should not move nor rotate the target to keep things independent.
It's easily doable externally, like you did in the piece of code you wrote in your first post.
yeah cool
nehon said:
I'm not sure to understand, you want to be able to rotate the camera around the target without clicking on the mouse button?
If that's it, i guess i can add a clickToDrag boolean like it's done for the flyby camera.
There is no real reason it's not supported, i'm open to suggestions. I made the cam from scratch, and i don't have a clue of how it worked in JME2.
Another thing, you can have a "look around" behavior when you zoom in to the max.
I have a bit of time to get into jme again was the click drag boolean thing added, can't seem to find it, I have all other behavior working nicely
oups no…sorry i forgot about this one, i’ll add it and keep you informed
@nehon
Have you taken a look at what I described for the chase cam view skewing? I made a post about it somewhere, I don’t remember where exactly.
To reiterate, sometimes the chase cam, instead of sitting correctly level, will be skewed about 45 degrees. If you run the game I sent you it does it once in a while (if you still have it). You can also see it in the videos I posted.
Sorry to @mcbeth. I don’t want to hijack your thread, but reading this post made me think about this.
@mcBeth it’s in last SVN use dragToRotate(false) to always rotate
@madjack don’t really understand the issue, but i’m gonna look at it
thanks for this nehon work great, some questions through…um how come there is no setDefaultHeight or am I missing it, I’m trying to position the chase cam slightly overlooking my character, also can you methods to getCurrent vertical horizontal rotation or explain how to add them some bits in my jme 2 game I was using these values to influence fight move selection.
the setVerticalRotation caught me though, tried using 179 to counter an issue that presents when the cam hits 180 degrees directctly o over the character, have seen that before, it was a known issue with Lex’s strategyCam, but I digress, had to use 1.5, could you explain the conversion a bit
thanks in advance
use setDefaultVerticalRotation(float angle). The angle is in radians, thus the conversion.
You have a FastMath.DEG_TO_RAD variable to easily transform degrees in radians ( degAngle*deg_to_rad= radAngle);
I’ll add getters for current vertical and horizontal rotation, also distance.
please dont forget setDefaultHeight and thanks again for the other stuff
hum…?
maybe i misunderstood what do you mean by set default height?
The height the camera looks at or the height of the camera itself?
the height of the camera itself , I could find no way to adjust that, I want it behind the character, but also slightly above the character, it seems as the the cam height is hard-coded…in the TestWalkingChar which I’m building from, the oto model impedes your view of anything directly in front of it.
ok so as i said before use the setDefaultVerticalRotation(float angle)
this is the angle between the floor and the vertical axis, so setting it to 45* Deg_to_rad will set it at 45° from the floor
It doesn’t work…um how can I explain this…um …ok… as of now the camera pivot point is at or seems to be at oto’s feet/ lower half, as a consequence when the cam is at “0 degrees looking straight down Z” oto impairs the view because he is directly in front of the camera which itself seems to be feet level… I want that “0 degree” position / pivot point to be slightly above his head (it would also make it possible to look up) which presently cant happen, I’m guessing because the cam is constrained from going under the terrain. setDefaultVerticalRotation(float angle) doesn’t do that it set the cam at a 45 deg angle looking down
to illustrate what I want to do
x <— where I want the cam’s pivot point to be
0 ← head
I
/ ← feet <— where the cam’s pivot point appears to be now