(C++) WoW style custom controls with camera and more
-
- Posts: 25
- Joined: Sun Nov 12, 2006 7:51 pm
- Contact:
(C++) WoW style custom controls with camera and more
Here is my WoW style Biped controller and camera code
with this you can make a .md2 file walk, strafe, jump, crouch, and possibly in the future, swim
It has ground (terrain) collision detection and gravity
unfortunately, not very well documented, but not extremely complicated
controls for demo:
WASD for direction, mouse to aim, hold shift to run, space to jump and C
to crouch, mouse Left+right walk forward, hold mouse right to strafe, hold mouse left to move camera
Sorry there is no documentation as this is a work in progress...
Here are some things you can do in your own programs:
Set Animation Frame Sets for your model for each state of motion (Jumping, running, strafing, etc.)
Set Gravity value
Set Jump Force
Set Walk and Run Speeds
Customize control Keys (not mouse)
here are the links to source and demo
http://jreuschel1.tripod.com/irrlicht.htm
with this you can make a .md2 file walk, strafe, jump, crouch, and possibly in the future, swim
It has ground (terrain) collision detection and gravity
unfortunately, not very well documented, but not extremely complicated
controls for demo:
WASD for direction, mouse to aim, hold shift to run, space to jump and C
to crouch, mouse Left+right walk forward, hold mouse right to strafe, hold mouse left to move camera
Sorry there is no documentation as this is a work in progress...
Here are some things you can do in your own programs:
Set Animation Frame Sets for your model for each state of motion (Jumping, running, strafing, etc.)
Set Gravity value
Set Jump Force
Set Walk and Run Speeds
Customize control Keys (not mouse)
here are the links to source and demo
http://jreuschel1.tripod.com/irrlicht.htm
Last edited by jreuschel1 on Sun Sep 02, 2007 4:04 pm, edited 2 times in total.
I have no problems to download the files...
(right click - save target as)
(right click - save target as)
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
I can't believe it!!! this is was i was trying to get in my game!!!! i tested it and it works incredibly perfect!!!!!!! Thanks man!!!!!!!!!!!!!!!!!!!!!!!
Greeting from Argentina!!!
Greeting from Argentina!!!
A caos world where only the strongest lives, weak is not an option... you must fight.. Nokturna!!
http://nokturna.varholl.com.ar
http://nokturna.varholl.com.ar
Add smooth camera zooming in the MovePlayerControll :]
add:
Maybe not the best way to do it but it works
add:
Code: Select all
const float CamSpeed = 3.15f;
const float CamUpdateSpeed = 0.005f;
float CamZoomOffset = 100.0f;
if(MWHEEL!=0)
{
CamZoomOffset += CamSpeed * MWHEEL * ElapsedTime;
if(CamZoomOffset < 10.0f )CamZoomOffset = 10.0f;
if(CamZoomOffset > 200.0f )CamZoomOffset = 200.0f;
MWHEEL = 0;
}
CamZoom += ( CamZoomOffset - CamZoom ) * CamUpdateSpeed * ElapsedTime;
Last edited by xsocom on Tue Oct 23, 2007 7:45 pm, edited 3 times in total.
Hm I played wow for a while and one more thing about the camera, when you rotate around your player the camera rotates back behind the player when you lift the mouse button up, or something like that..
Well use the same thing here, it works but also not the best way to do it
and above the WSAD1.Tick( .. ) in the end of the code.
also add some sort of rotation check under "CamPan=CamPan+(MOUSEX-OLDMPOSX)/3.0f; "
Cheers
Well use the same thing here, it works but also not the best way to do it
Code: Select all
void ResetCamera( float ElapsedTime )
{
CamPan += ( CamReset - CamPan ) * 0.005f * ElapsedTime;
}
Code: Select all
if( MBLEFT==0 )
{
ResetCamera( ElapsedTime );
}
Code: Select all
if( CamPan >= 360.0f ){
CamPan = 0.0f;
}
if( CamPan < -360.0f ){
CamPan = 0.0f;
}
-
- Posts: 6
- Joined: Wed Oct 17, 2007 5:07 pm