Hold shift to make the FPS camera go faster
well, there is no setMoveSpeed() function for the camera, yet...dlangdev wrote:cast the camera object to CCameraFPSSceneNode and call its member function setMoveSpeed().
maybe you're using my IrrExtension where I added this function to ???
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
Yes, there IS a setmovespeed.
Please look around before posting untrue information
-dudMan
Code: Select all
282 //! Sets the movement speed
283 void CCameraFPSSceneNode::setMoveSpeed(const f32 speed)
284 {
285 MoveSpeed = speed;
286
Code: Select all
http://irrlicht.svn.sourceforge.net/viewvc/irrlicht/trunk/source/Irrlicht/CCameraFPSSceneNode.cpp?revision=964&view=markup
-dudMan
Complete Irrlicht Beginners Tutorial
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=24898
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=24898
yeah, but you can't access it (without modifying the engine)...
or am I wrong again ???
if so, then please show me how to access it !!!
and please not with the svn version, but with the official release...
or am I wrong again ???
if so, then please show me how to access it !!!
and please not with the svn version, but with the official release...
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
from CSceneManager.cpp
notice the return type is ICameraSceneNode, it doesn't return the handle to the CCameraFPSSceneNode interface, but you can get the interface by simply casting the camera object to CCameraFPSSceneNode and you'll be able to call its members.
Sample code
notice the return type is ICameraSceneNode, it doesn't return the handle to the CCameraFPSSceneNode interface, but you can get the interface by simply casting the camera object to CCameraFPSSceneNode and you'll be able to call its members.
Code: Select all
//! Adds a camera scene node which is able to be controled with the mouse and keys
//! like in most first person shooters (FPS):
ICameraSceneNode* CSceneManager::addCameraSceneNodeFPS(ISceneNode* parent,
f32 rotateSpeed, f32 moveSpeed, s32 id,
SKeyMap* keyMapArray, s32 keyMapSize, bool noVerticalMovement,f32 jumpSpeed)
{
if (!parent)
parent = this;
ICameraSceneNode* node = new CCameraFPSSceneNode(parent, this, CursorControl,
id, rotateSpeed, moveSpeed, jumpSpeed, keyMapArray, keyMapSize, noVerticalMovement);
node->drop();
setActiveCamera(node);
return node;
}
Code: Select all
// create camera...
scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
//cast it.
//you get the idea...
(CCameraFPSSceneNode*)camera->setMoveSpeed(aNumber);
Last edited by dlangdev on Thu Nov 29, 2007 8:57 pm, edited 2 times in total.
I know exactly what you mean, but this doesn't work, as far as CCameraFPSSceneNode is encapsulated in the engine and you can't cast a ICameraSceneNode to it, just try it and you'll see !!!dlangdev wrote:Sample code
Code: Select all
// create camera... scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS(); //cast it. //you get the idea... (CCameraFPSSceneNode*)camera->setMoveSpeed(aNumber);
and btw assuming this would work, then it has to be like this:
Code: Select all
((CCameraFPSSceneNode*)camera)->setMoveSpeed(aNumber);
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
Thanks acki for responding.
I'm a bit worked-up with this thread because i'll be adding the same feature to the sample program #16 i'm currently adding code.
so, i really appreciate all your inputs as well.
i'll be able to see if casting will work or not later.
thanks again for your patience, it's becoming like a debate in C++. pardon my stubbornness.
I'm a bit worked-up with this thread because i'll be adding the same feature to the sample program #16 i'm currently adding code.
so, i really appreciate all your inputs as well.
i'll be able to see if casting will work or not later.
thanks again for your patience, it's becoming like a debate in C++. pardon my stubbornness.
no need for pardons
I'm not all-knowing and we all never finish learning, so from time to time I also could be wrong
especially because the engine is growing realy fast and sometimes I don't realise that something was changed that didn't work in previous versions...
and always remember I'm just talking about the official versions, so it could also be that some things are already implemented in the svn I don't know about...
I'm not all-knowing and we all never finish learning, so from time to time I also could be wrong
especially because the engine is growing realy fast and sometimes I don't realise that something was changed that didn't work in previous versions...
and always remember I'm just talking about the official versions, so it could also be that some things are already implemented in the svn I don't know about...
returned to sender !!!dudMaN wrote: Please look around before posting untrue information
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
by the way, it turns out acki was right.
so i had to use the animator object to tweak the translation of the xz plane.
though i still not sure if tweaking the translation is the right way to do it.
the rest of the code is found here ...
http://irrlicht.sourceforge.net/phpBB2/ ... tanimators
so i had to use the animator object to tweak the translation of the xz plane.
though i still not sure if tweaking the translation is the right way to do it.
Code: Select all
scene::ISceneNodeAnimatorCollisionResponse* animator = findSceneNodeAnimator_CollisionResponse(camera);
if (animator)
//animator->setGravity(core::vector3df(0, -1, 0)); // disable gravity
animator->setEllipsoidTranslation(core::vector3df(0, -1, 0)) ;
http://irrlicht.sourceforge.net/phpBB2/ ... tanimators
lol @ dudMaN !!!dlangdev wrote:by the way, it turns out acki was right.
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