Character Controller

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Character Controller

Postby LukasBanana » Fri Feb 12, 2010 12:27 pm

Hi everybody,
I am developing a first person shooter using my own 3d engine (the SoftPixel Engine) and NewtonGameDynamics.
But before I can integrate the PhysicsEngine in my GameEngine I have to make some tests in seperated small programs to see, how I have to use Newton SDK for things like the character controller.
I know there is an example in the new SDK but it is not so easy for my to comprehend the source code (of the Tutorial).
I hope it is not so difficult to write a character controller so that Newton assumes already the most work - programmers are lazy ^^

Currently I make it wrong :lol: well, I use NewtonUpVectorSetPin function to set the player upright.
But to walk I just the NewtonBodySetVelocity function. This do not work really nice. Maybe I have some wrong parameters set to the material.
I also use the capsule for the player.

My concrete question is, what are the main functions and main technics for a character controller?
Thank you once already in advance :)
My project: SoftPixel Engine
My forum: SoftPixel Forum
User avatar
LukasBanana
 
Posts: 35
Joined: Mon Jul 27, 2009 11:55 am
Location: Germany

Re: Character Controller

Postby PJani » Fri Feb 12, 2010 2:57 pm

You have CharacterController in jointlibrary.
| i7-5930k@4.2Ghz, EVGA 980Ti FTW, 32GB RAM@3000 |
| Dell XPS 13 9370, i7-8550U, 16GB RAM |
| Ogre 1.7.4 | VC++ 9 | custom OgreNewt, Newton 300 |
| C/C++, C# |
User avatar
PJani
 
Posts: 448
Joined: Mon Feb 02, 2009 7:18 pm
Location: Slovenia

Re: Character Controller

Postby LukasBanana » Fri Feb 12, 2010 3:47 pm

But it's not included in the DLL file.
Do I have to include and compile the *.cpp files ("CustomKinematicController.cpp" etc.) in my own project?
My project: SoftPixel Engine
My forum: SoftPixel Forum
User avatar
LukasBanana
 
Posts: 35
Joined: Mon Jul 27, 2009 11:55 am
Location: Germany

Re: Character Controller

Postby kallaspriit » Fri Feb 12, 2010 6:45 pm

No, link the JointLibrary.dll ;)
kallaspriit
 
Posts: 216
Joined: Sun Aug 14, 2005 6:31 pm

Re: Character Controller

Postby Julio Jerez » Sat Feb 13, 2010 12:51 am

Player controllers are hard to make, poeple spend years making themn and bever get even decent results. that include comercial project by enlarge are quite Bad.
I looking at eteh joint impelemnetation, it si not that hard to follow and I contatly makin improvemenst
Play the demo and if you like it maybe it is worth the effort to leren it. if you can use the UpVcetor Joint, then you can use the JointLibrary.
basically you just make a body and asign the Player controller, that all there is to it, maybe for of five line of code.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character Controller

Postby LukasBanana » Sat Feb 13, 2010 2:35 pm

Okay I linked the JointLibrary.lib and found the JointLibrary.dll but when I try to compile the compiler shows an error:

Code: Select all
undefined reference to 'NewtonCustomJoint::operator new(unsigned int)'
 "" CustomPlayerController::CustomPlayerController( ....)
 "" NewtonCustomJoint::operator delete(void*)

Could it be that I forgot anything??
My project: SoftPixel Engine
My forum: SoftPixel Forum
User avatar
LukasBanana
 
Posts: 35
Joined: Mon Jul 27, 2009 11:55 am
Location: Germany

Re: Character Controller

Postby LukasBanana » Sun Feb 14, 2010 11:19 am

I don't understand why the link to the "JointLibrary.lib" file does not work.
I'm sure I linked it right. I used the file from the directory "NewtonWin-2.04\sdk\x32\JointLibrary.lib", that's the only one I can use,
the other one is x64.
Do I have to include the C++ files from the JointLibrary (e.g. "CustomPlayerController.cpp" etc.) to my project additional or not??
Please help me, I am new with Newton SDK. :oops:
My project: SoftPixel Engine
My forum: SoftPixel Forum
User avatar
LukasBanana
 
Posts: 35
Joined: Mon Jul 27, 2009 11:55 am
Location: Germany

Re: Character Controller

Postby Julio Jerez » Sun Feb 14, 2010 11:36 am

But it does work, can you run the demos? they are linked to the joint library DLL.

The library is not different that any other library of any other project. So being new to Newton have should have nothing to do with this probem.

you do not need to include the cpp files, you only need the headers. these are the folders
C:\Newton_200\NewtonSDK\sdk\x32\JointLibrary.lib
C:\Newton_200\NewtonSDK\sdk\x32\JointLibrary.dll


I do not undertand how you could have link errors in a dll, the dll is compiled and thoses funtion will be linked with it.
Make sure are linking to the DLL and not to a LIB (which i beleive is not possible since for that you would need to build the source)


arternativelly if you are using visual studio, you could just add the Library project to your project as a dependency project, and it will compile the source for you.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character Controller

Postby LukasBanana » Sun Feb 14, 2010 12:13 pm

I'm using Code::Blocks with a new C++ compiler (GNU C++ 4.xx)
I don't understand why this linker error occurs as well.
I try to download the latest NewtonSDK - I have 2.04
My project: SoftPixel Engine
My forum: SoftPixel Forum
User avatar
LukasBanana
 
Posts: 35
Joined: Mon Jul 27, 2009 11:55 am
Location: Germany

Re: Character Controller

Postby Julio Jerez » Sun Feb 14, 2010 1:02 pm

you need 2.16
It is the version tah contaion teh best yet player controller, maybe version 2.16 does not has that problem
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character Controller

Postby LukasBanana » Sun Feb 14, 2010 1:13 pm

Still the same problem :(

newton.lib works perfect. But JointLibrary.lib not ?! :|

I have already tried to link all the other lib files (dMath.lib etc.) of 2.16 - no change

EDIT:

My linker settings are:

Code: Select all
D:\Anwendungen\C++\Libraries\NewtonWin-2.16\sdk\x32\dll_vs7\newton.lib
D:\Anwendungen\C++\Libraries\NewtonWin-2.16\sdk\x32\JointLibrary.lib


My compiler header directories are:

Code: Select all
D:\Anwendungen\C++\Libraries\NewtonWin-2.16\sdk
D:\Anwendungen\C++\Libraries\NewtonWin-2.16\sdk\dCustomJoints
D:\Anwendungen\C++\Libraries\NewtonWin-2.16\sdk\dMath
My project: SoftPixel Engine
My forum: SoftPixel Forum
User avatar
LukasBanana
 
Posts: 35
Joined: Mon Jul 27, 2009 11:55 am
Location: Germany

Re: Character Controller

Postby Julio Jerez » Sun Feb 14, 2010 2:28 pm

I do not know what tha could be theso function are in file NewtonCustomJoint.cpp
this is the code.
Code: Select all
void *NewtonCustomJoint::operator new (size_t size)
{
   return (void*) new char[size];
}
void NewtonCustomJoint::operator delete (void *ptr)
{
   delete (char*)ptr;
}


I have build the engine with MinGW and I did not have those errors.
I never use code block, do you use a project file in code block?
there have to be some bug in teh project setup.

you can try building the DLL, using code block, all of the source is in the SDk, or you can take the set up form teh Linux make file.
this is what I did.


I will download code block and try top make teh library. mayeb I can see what is wrong.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character Controller

Postby Julio Jerez » Sun Feb 14, 2010 2:35 pm

wow for what I can see code block is like and cross platform IDE, maybe I should tryr using it that for everythong
what version of these tow do you use:
codeblocks-8.02-setup.exe
codeblocks-8.02mingw-setup.exe
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character Controller

Postby Julio Jerez » Sun Feb 14, 2010 2:44 pm

wow this look too good to be true.
I download Code block, and I clik import project and some how it open the vosual studio solution with out errors.
I still do no beleive it, I am afradi to build it. but I will try.
Julio Jerez
Moderator
Moderator
 
Posts: 12452
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Character Controller

Postby LukasBanana » Sun Feb 14, 2010 3:09 pm

^^ yeah Code::Blocks is really good. Before this I used DevC++ (MinGW as well) but this is out of date.
I hope you can find the error when trying to compile the project with Code::Blocks.

Thank you before, that here the developer personally is very concerned about its users :D
My project: SoftPixel Engine
My forum: SoftPixel Forum
User avatar
LukasBanana
 
Posts: 35
Joined: Mon Jul 27, 2009 11:55 am
Location: Germany

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 394 guests

cron