Page 1 of 3

(C++) WoW style custom controls with camera and more

Posted: Fri Feb 16, 2007 8:04 pm
by jreuschel1
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

Posted: Fri Feb 16, 2007 8:12 pm
by m_krzywy
This file is hosted by Tripod, a LycosŽNetwork Site, and is not available for download. Please check out Tripod's Help system for more information about Remote Loading and our Remote Loading policy.




Dead link :(

Posted: Fri Feb 16, 2007 9:07 pm
by Acki
I have no problems to download the files...
(right click - save target as)

Posted: Fri Mar 16, 2007 7:10 pm
by kompromis
just enter the link in the adress field insted
and it will work just fine

Posted: Wed Mar 21, 2007 8:47 pm
by lukluk
Help i cant compile that :/ i have error HELP !

Posted: Mon Mar 26, 2007 8:19 am
by shadowlancer
help i cannot download the fiel

Posted: Sat Jul 14, 2007 2:31 pm
by varholl
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!!!

Posted: Thu Aug 30, 2007 6:00 pm
by MasterGod
Can't download...

Posted: Mon Oct 08, 2007 9:29 am
by xsocom
Nice work! Keep it up

Cheers!

Posted: Thu Oct 18, 2007 9:10 pm
by KakashiXP
it didnt work for me also, but when i opened the link with Internet Explorer, it works fine... so just try that :D 8)

Posted: Tue Oct 23, 2007 7:33 pm
by xsocom
Add smooth camera zooming in the MovePlayerControll :]

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;
Maybe not the best way to do it but it works :P

Posted: Tue Oct 23, 2007 7:41 pm
by xsocom
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 :P

Code: Select all

void ResetCamera( float ElapsedTime )
{
   CamPan += ( CamReset - CamPan ) * 0.005f * ElapsedTime;
}
and above the WSAD1.Tick( .. ) in the end of the code.

Code: Select all

if( MBLEFT==0 )
{
   ResetCamera( ElapsedTime );
}
also add some sort of rotation check under "CamPan=CamPan+(MOUSEX-OLDMPOSX)/3.0f; "

Code: Select all

if( CamPan >= 360.0f ){
   CamPan = 0.0f;
}
if( CamPan < -360.0f ){
   CamPan = 0.0f;
}
Cheers :P

Posted: Tue Oct 23, 2007 8:09 pm
by xsocom
Just one more thing I need to for camera is to make it adjust agains the terrain like in WoW, any tips :)?

Posted: Sat Oct 27, 2007 2:09 pm
by WarShattrith
Make at the camera position a small box. Then collide this box with the terrain. Finally, position the camera to the box.

Posted: Sat Oct 27, 2007 6:01 pm
by xsocom
any sample on how you do it? sounds simple as you said it, but I think its a little more komplicated, get an smooth terrain collision is hard I think.