Page 1 of 1
Can't make a new topic
Posted: Mon Jun 27, 2011 4:59 pm
by cooky451
Hi,
I'm from Germany so if anyone feels like answer in german -> great! (My english is not that good..)
I'm not able to start a new Topic at "beginners help". I have absolutely no idea why. When I click on the "new topic" button the forum directs me directly back to the main site.
:?::?:
My problem:
How can I add collision detection + gravity to a model/mesh, like I can do this for the camera (tutorial 07)? Simple code would be great!
Posted: Mon Jun 27, 2011 5:20 pm
by shadowslair
The code is already in the 07 example:
Level collision:
Code: Select all
selector = smgr->createOctreeTriangleSelector(
q3node->getMesh(), q3node, 128);
q3node->setTriangleSelector(selector);
Player Collision:
Code: Select all
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, ###CAMERA###, core::vector3df(30,50,30),
core::vector3df(0,-10,0), core::vector3df(0,30,0));
selector->drop(); // As soon as we're done with the selector, drop it.
###CAMERA###->addAnimator(anim);
anim->drop();
Simply create an I(Animated)MeshSceneNode and replace the ###CAMERA### with its pointer. Just refer to the documentation if you have some doubts what are all these parameters used for.
Posted: Mon Jun 27, 2011 6:14 pm
by cooky451
Thanks for helping me, but it still doesn't want to work. I want a collision detection between two Models (Model & Level).
Code: Select all
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("ninja.b3d"),
0, IDFlag_IsPickable | IDFlag_IsHighlightable);
node->setScale(core::vector3df(10, 10, 10));
node->setPosition(core::vector3df(-70,100,-600));
node->setRotation(core::vector3df(0,90,0));
node->setAnimationSpeed(10.f);
node->getMaterial(0).NormalizeNormals = true;
scene::ITriangleSelector *sel = smgr->createTriangleSelector(node);
node->setTriangleSelector(sel);
sel->drop();
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, node, core::vector3df(30,50,30),
core::vector3df(0,-10,0), core::vector3df(0,30,0));
selector->drop();
node->addAnimator(anim);
anim->drop();
While "selector" was created like in the tutorial:
Code: Select all
selector = smgr->createOctreeTriangleSelector(
q3node->getMesh(), q3node, 128);
q3node->setTriangleSelector(selector);
Posted: Mon Jun 27, 2011 6:14 pm
by CuteAlien
No idea why new topic doesn't work for you. Maybe it was some temporary problem. Anyway - I'll just move this one to beginner.
Posted: Mon Jun 27, 2011 6:40 pm
by cooky451
CuteAlien wrote:Maybe it was some temporary problem.
It's still the same. The "new topic" button links me to
http://irrlicht.sourceforge.net/phpBB2/ ... wtopic&f=1
and this link redirects me to
http://irrlicht.sourceforge.net/phpBB2/index.php
Posted: Mon Jun 27, 2011 7:06 pm
by CuteAlien
Sorry, really no idea right now. That links allows me typing a topic (and I'm also sitting in germany).
Anyone else got an idea?
Posted: Mon Jun 27, 2011 7:19 pm
by omg_fail
An internal server error I think.
Like you said its just temporary.
Warte einfach ein paar tage dann solltes wiedergehen wenn nicht schau mal auf deinen Internet acces
About the collision :
Benutzt du nur das model oder lädst du eine irr scene ?
Weil grafity ohne boden wäre keine gute idee
Und noch was :
Wenn du möchtest dass zwei z.B. ninjas nicht ineinander laufen solltest du zu einem physik engine greifen
Posted: Mon Jun 27, 2011 7:24 pm
by omg_fail
Wegen dem new topic :
Welchen browser verwendest du und welche version ? Könnet daran liegen.
...
Am i actually allowed to write in german
Posted: Mon Jun 27, 2011 7:37 pm
by ent1ty
No, you are only allowed to write: English, Dutch, Czech and Slovak
Posted: Mon Jun 27, 2011 7:38 pm
by cooky451
I'm using Firefox 4 (5?) with Windows 7, this shouldn't be the problem
@Topic:
I made a "ground", which actually is my level. Collision detection + gravity works fine with the camera, but it doesn't want to work for the ninja. (He hangs around at ~1m over the ground
)
Posted: Mon Jun 27, 2011 7:47 pm
by shadowslair
He hangs around at ~1m over the ground
As I already said try playing a bit with the collision ellipsoid parameters:
Code: Select all
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, node,
core::vector3df(30,50,30), //<<<<<<<<<<<<< imagine a box with width of 30 and height of 50. The third parameter is the same as the first
core::vector3df(0,-10,0),
core::vector3df(0,30,0)); //<<<<<<<<<<<<< on Y axis- start with 0 and increase/decrease
Posted: Mon Jun 27, 2011 7:56 pm
by cooky451
OMG! Thanks!
I thought the hole time that I was creating him at this point and that the gravity wouln't have any effect on him.
Creating with (1,1,1) and (0,0,0) works fine.
Posted: Mon Jun 27, 2011 8:31 pm
by hybrid
Remove all your cookies etc. and re-login. This should help with such problems.
Posted: Mon Jun 27, 2011 8:51 pm
by cooky451
hybrid wrote:Remove all your cookies etc. and re-login. This should help with such problems.
Works fine, thanks.