FunCollision v1.0 Source + Bin + Tutorials
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
hey
can u help me a bit please?
if i add a terrain, set its position (not initially, but after creating, and before creating the selector), the selector isnt made in the new position, but the old. same happens to the scale too.
i need this, because im using deserializeAttributes, what makes an empty terrain, then load the datas into this.
So i need to somehow, update the LOD maybe?
thanks
can u help me a bit please?
if i add a terrain, set its position (not initially, but after creating, and before creating the selector), the selector isnt made in the new position, but the old. same happens to the scale too.
i need this, because im using deserializeAttributes, what makes an empty terrain, then load the datas into this.
So i need to somehow, update the LOD maybe?
thanks
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
Well, you simply pass your character node to the entity, not the camera node and you have a character model to get updated by the entity. Sth like:
Then set the position of your camera accordingly to myNode position and you`re done.
Code: Select all
scene::IAnimatedMeshSceneNode* myNode = smgr->CREATE YOUR NODE HERE AS USUAL
ent = cmgr->addEntity(core::vector3df(0, 0, 40), sphereSampler, myNode);
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
shadowslair wrote:Well, you simply pass your character node to the entity, not the camera node and you have a character model to get updated by the entity. Sth like:Then set the position of your camera accordingly to myNode position and you`re done.Code: Select all
scene::IAnimatedMeshSceneNode* myNode = smgr->CREATE YOUR NODE HERE AS USUAL ent = cmgr->addEntity(core::vector3df(0, 0, 40), sphereSampler, myNode);
That' s ok.
But to move the entity i must use Entity->addForce(VectForward * Speed)
I have no plan for VectForward.Sorry I'am not a Profi.
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
the addForce() just takes a direction vector in world space. It is say a normalized vector multiplied by some speed value. If you wanna your character to move on the X axis only, you set camForward to (1,0,0) *speed etc.
You probably want to rotate your character using the keys and move in his facing direction. Then you simply do:
or sth alike. Too lazy to test itr right now, but it should be working as expected with minor tweaks.
You probably want to rotate your character using the keys and move in his facing direction. Then you simply do:
Code: Select all
// in CGameCamera.h or whatever you name it
f32 charPanAngle; // your character angle around Y axis in WS
// in CGameCamera constructor:
charPanAngle = 0; // init var to some value -> your initial rotation
// in CGameCamera::updateMovement() on the correct place:
f32 rotationSpeed = 0.6f;
charPanAngle += (game->getInput()->getKeyDown(irr::KEY_KEY_D) - game->getInput()->getKeyDown(irr::KEY_KEY_A) ) * rotationSpeed;
// way-to-do-it 1:
core::vector3df camForward = core::vector3df(0,0,1);
camForward.rotateXZBy(charPanAngle);
// way-to-do-it 2:
core::vector3df rotPan(0, charPanAngle, 0);
core::vector3df camForward = rotPan.rotationToDirection();
// now you have a direction vector (normalized)
float runSpeed = 0.1f // depends on your game world scale
// do sth to move it in the needed direction:
if (game->getInput()->getKeyDown(irr::KEY_KEY_W) || game->getInput()->getKeyDown(irr::KEY_UP)) ent->addForce(camForward * runSpeed);
if (game->getInput()->getKeyDown(irr::KEY_KEY_S) || game->getInput()->getKeyDown(irr::KEY_DOWN)) ent->addForce(-camForward * runSpeed);
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
i'm interested in the source for this still, please update it. i got the old one running on linux and it was great.
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
-- https://github.com/netpipe/Luna Game Engine Status 95%
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
I`m not authorized for such an answer, but as he said you email him for the latest source. Problem with updating the first post is, that version 1.1 is not ready for official release- with demos, docs, tuts, examples and on. It contains a few API changes and bugfixes...tecan wrote:i'm interested in the source for this still, please update it. i got the old one running on linux and it was great.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
-
- Posts: 758
- Joined: Mon Mar 31, 2008 3:32 pm
- Location: Bulgaria
No, not at all. I can always dig it from "da-dusty-shelf".PI wrote:@shadowslair: You're 100% authorized Also, I've told him you've got a working version of it, and to contact you if he wants it, I hope you don't mind!
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."