by chmmr213
on 03/09/2007 20:41, 7 messages, last message: 03/16/2007 21:24, 1318 views, last view: 04/11/2024 01:19 |
OK to start out.. excellent engine IMHO.
I was able to make the arrow keys rotate the player up to down and left to right just using the built in pl->yaw and pl->pitch. You know, make the binded commands like pitchup and pitchdown. Also new char like t_turn and t_pitch and new bools so the code ended up looking like this..
dir(pitchup,t_pitch,-1,k_dwn,k_uup);
dir(pitchdown,t_pitch,1,k_uup,k_dwn);
dir(yawleft,t_turn,1,k_lft, k_rght);
dir(yawright,t_turn,-1,k_rght,k_lft);
Then later on force the movement to happen in another function like modifyvelocity or what have you;
pl->yaw += pl->t_turn;
pl->pitch += pl->t_pitch;
fixcamerarangeang();
To compensate so the camera follows tighter I fudged what you did with fixcamerarange and actually made it to be sure to follow the yaw and pitch the player is at.
Now this is all fine and dandy and makes me realize that you dont have it because you dont want it in your game which is something one must respect.
As far as what I just bumbled together up there it works fine for a first person shooter because the views and angles are locked at max and mins before the formula would have the opposite effect desired. IE when the -1 or positive 1 would flip it when yawing at a certain pitch degrees... gimbal lock I believe...........I am coding a space game with your great engine.
You do have something that will rotate_around_z, _x, _y, but sadly when using the pl->, there is no x,y,z indicated as an option from the physent. Anyhow, I think you can quess my next question... Is there a function that is already in here that will give the player entity's x,y and z axis so I may rotate upon it or will I need to create the process to find that x,y,z axis? I am fairly certain that of course the player entity has an x,y,z so that is why I ask this more than likely stupid question.
|
I understood what he was saying, but I knew that this would indeed be deemed a frivolous and unecessary feature.
Not to mention the fact that I have already done this in the past while testing Sauerbraten's usability for different game types such as an adventure (a-la Mario 64, etc) game. I've even gone as far to totally rework the movement logic for use with a Wii Remote.
Things like this aren't necessary for Sauerbraten, but are indeed useful to the Modding Community. Make a release on http://quadropolis.us/ with some well written documentation, then you might find it gets used by others interested in the functionality, as we all have the option of modifying and compiling our own Sauerbraten client for things we specifically want but don't have.
reply to this message
|