Smooth mixed 1st + 3rd Person Camera Scene Node (for RPG)

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
CodeDog
Posts: 106
Joined: Sat Oct 07, 2006 8:00 pm
Location: CA. USA
Contact:

Post by CodeDog »

I changed the (const SEvent& event) which solved the abstract class problem I was having but now I get an error "unresolved external link" for functions recalculateBoundingBox and recalculateViewArea.
Have these functions changed also?
Avalanche
Posts: 18
Joined: Tue Sep 05, 2006 7:21 am

Post by Avalanche »

Error 9 error LNK2001: unresolved external symbol "public: __thiscall irr::scene::CCameraRPGSceneNode::CCameraRPGSceneNode(class irr::scene::ISceneNode *,class irr::scene::ISceneManager *,int const &,class irr::IrrlichtDevice *,class irr::scene::ITriangleSelector *,class irr::core::string<char,class irr::core::irrAllocator<char> > const &)" (??0CCameraRPGSceneNode@scene@irr@@QAE@PAVISceneNode@12@PAVISceneManager@12@ABHPAVIrrlichtDevice@2@PAVITriangleSelector@12@ABV?$string@DV?$irrAllocator@D@core@irr@@@core@2@@Z) main2.obj

i have no idea about this external symbol error
CodeDog
Posts: 106
Joined: Sat Oct 07, 2006 8:00 pm
Location: CA. USA
Contact:

Post by CodeDog »

I have the RPG camera errors fixed and I have even added "Jump" to the cameras animator. It works with the latest SVN version.
Would you like me to post a link to the modified RPG camera source code?
seppuku arts
Posts: 17
Joined: Mon Oct 30, 2006 12:39 pm

Post by seppuku arts »

Hey dudes, looks like a nice resource, I get a linker error on this one, I set all of the directories in the DevC++ project file after putting into examples to where mine are (linkers and headers) but I get this error;

[Linker error] undefined reference to `irr::scene::CCameraRPGSceneNode::CCameraRPGSceneN...

Id returned 1 exit status

[Build Error] [example.exe]Error 1
Running into walls is not a good idea...Trust me
xterminhate
Posts: 206
Joined: Thu Sep 01, 2005 9:26 pm
Location: France

Post by xterminhate »

CodeDog wrote:I have the RPG camera errors fixed and I have even added "Jump" to the cameras animator. It works with the latest SVN version.
Would you like me to post a link to the modified RPG camera source code?
Please, yes. I will add the code update to the first page !

Xter.
Return to Irrlicht after years... I'm lovin it.
It's hard to be a Man !
Si vis pacem para belum
xterminhate
Posts: 206
Joined: Thu Sep 01, 2005 9:26 pm
Location: France

Post by xterminhate »

Camera V8 has been uploaded. I tried my camera with the last official release of Irrlicht revision (1.1) and it worked fine.

I would have liked to try my camera with the last SVN, but all Irrlicht related servers were down. I spent a day trying to access Irr home page, forum page, downloads, etc.

How is it possible to condisider in using this engine in serious project with such hosting problems ?

Xter.
Return to Irrlicht after years... I'm lovin it.
It's hard to be a Man !
Si vis pacem para belum
ssexton
Posts: 54
Joined: Wed Oct 25, 2006 7:46 am
Location: South Florida
Contact:

Post by ssexton »

Wow... that's four hours of my life I want back...

This camera somewhat works, but setting it up is a pain, and it has some bugs. For newcomers, the attributes you will want (need?) to configure are:

camera_min_distance:
This controls the initial distance between camera and your model. I'd suggest setting it to something very very small (say 4), this will should give you a view inside your models geometry. Then back up until you find the real minimum distance you want for your model.

camera_height_offset:
This controls where on your model the camera is aimed at. Once you get the min distance tuned, adjust this until its pointing at a good place on your model.

camera_default_z_rotation:
This controls the angle between the camera and your model. Negative values are "above" your model, 0 is directly behind (not a good idea, as it'll render to the horizon line), and positive is below.

Also, two bugs to watch out for, that may or may not affect you (I haven't tracked them down yet):

1. The turn_left and turn_right keys don't work at all like you expect. Neither the camera or the model turns. But, the "heading" of your model changes, so when you press forward/backward it will move in that direction.

2. Mouselook does not work. At least, it is not working for me. At all.
xterminhate
Posts: 206
Joined: Thu Sep 01, 2005 9:26 pm
Location: France

Post by xterminhate »

Just ask for support. I let my email and my msn on the forum ! :)

If you know the GW and WoW camera style, use of turn keys is not a problem.

Can you explain me the problem with the mouse look. It works fine for all of us. Did you press the mouse button to activate it ?

Do not hesitate to contact me. Any way, you are free to use or develop your own camera, if this one does not suit you ! ;)

Xter.
Return to Irrlicht after years... I'm lovin it.
It's hard to be a Man !
Si vis pacem para belum
ssexton
Posts: 54
Joined: Wed Oct 25, 2006 7:46 am
Location: South Florida
Contact:

Post by ssexton »

Thanks, x. The main reason I made the post was to explain the steps I did to configure the camera. It took me a long time, because the camera was so far away I couldn't figure out where it was in my scene. This laptop doesn't have a mousewheel, and mouselook wasn't working for me yet, so it was all .xml changes.

I figured out my turn keys problem. camera_default_y_rotation_speed and camera_default_z_rotation_speed were 0. It is working now.

I also figured out the mouse look problem. I am using a one-button Mac and the IrrlichtDevice was missing the code to do the emulated right mouse.

Now I just need to figure out why the camera is pointing at the left side of my .x model, instead of behind it. And why forward/backward are reversed. It has to be something with this model, the camera is working fine for sydney.md2.
xterminhate
Posts: 206
Joined: Thu Sep 01, 2005 9:26 pm
Location: France

Post by xterminhate »

Try to change those paramters :

<player_offset_rotation_x angle="0"/> <--- 90, 180, 270
<player_offset_rotation_y angle="0"/> <--- 90, 180, 270
<player_offset_rotation_z angle="0"/> <--- 90, 180, 270

That change de orientation of the model.

Xter.
Return to Irrlicht after years... I'm lovin it.
It's hard to be a Man !
Si vis pacem para belum
syntax03f
Posts: 2
Joined: Tue Nov 21, 2006 4:20 pm
Location: US

movement

Post by syntax03f »

xterminhate, I just wanted to say thank you! Your example is very interesting and shows me exactly how I wanted to construct my movement system. Very good work my friend!

-Syntax
xterminhate
Posts: 206
Joined: Thu Sep 01, 2005 9:26 pm
Location: France

Post by xterminhate »

Thank you, syntax03f !

Do not hesitate to contact me for support. Good luck. :wink:
Return to Irrlicht after years... I'm lovin it.
It's hard to be a Man !
Si vis pacem para belum
syntax03f
Posts: 2
Joined: Tue Nov 21, 2006 4:20 pm
Location: US

Post by syntax03f »

Avalanche wrote:Error 9 error LNK2001: unresolved external symbol "public: __thiscall irr::scene::CCameraRPGSceneNode::CCameraRPGSceneNode(class irr::scene::ISceneNode *,class irr::scene::ISceneManager *,int const &,class irr::IrrlichtDevice *,class irr::scene::ITriangleSelector *,class irr::core::string<char,class irr::core::irrAllocator<char> > const &)" (??0CCameraRPGSceneNode@scene@irr@@QAE@PAVISceneNode@12@PAVISceneManager@12@ABHPAVIrrlichtDevice@2@PAVITriangleSelector@12@ABV?$string@DV?$irrAllocator@D@core@irr@@@core@2@@Z) main2.obj

i have no idea about this external symbol error
And anyone else having any form of external symbol linking errors you need to add all the existing cpp/h/hpp of the rpgcamera files to your project to make all the varibles defined within them available to your project and that will solve your LNK errors.

Solution explination:
In your solution explorer within MSVC++ right click and find add existing resource and select all RPGCamera files then click ok and recompile.
xterminhate
Posts: 206
Joined: Thu Sep 01, 2005 9:26 pm
Location: France

Post by xterminhate »

You're right. All source file provided are required in order to build a project that uses that camera.

Thanks.
Return to Irrlicht after years... I'm lovin it.
It's hard to be a Man !
Si vis pacem para belum
neppyweb
Posts: 22
Joined: Thu Nov 23, 2006 12:44 pm

Still confuse

Post by neppyweb »

I have error in this line. Can you help me to open this project

scene::ISceneNode* q3node = smgr->addOctTreeSceneNode(q3levelmesh->getMesh(0));

"Unhandled exception at 0x00421e87 in IrrCameraRPG.exe: 0xC0000005: Access violation reading location 0x00000000."

And in Dos it show "Could not load mesh,because file could not be open.: 20kdm2.bsp"

What Should I do???
Post Reply