Physics plugged in, everything works. But how to create the player model which would be moved? As I understand it, we must create not visible object, create a node player and stick it in an invisible capsule. Capsule I created, throwing in her cubes face and fall. But how to attach the player model and movement?
ps After that I want to put the camera inside the capsule and it was very eye
irrlicht + bullet: character controller
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: irrlicht + bullet: character controller
Not sure what you are trying to say (tip; read through what you wrote to make sure it is possible to follow the text)
Create the bullet character controller as an irrlicht node, then parent the mesh to that node and you're kind of done
Create the bullet character controller as an irrlicht node, then parent the mesh to that node and you're kind of done
"this is not the bottleneck you are looking for"
Re: irrlicht + bullet: character controller
Forgot the code to show
But, how to get a position not visible object?
Code: Select all
btTransform startTransform;
startTransform.setIdentity();
startTransform.setOrigin(btVector3(0.0f, 300.0f, 0.0f));
GhostObject = new btPairCachingGhostObject();
GhostObject->setWorldTransform(startTransform);
Capsule = new btCapsuleShape(300, 200);
GhostObject->setCollisionShape(Capsule);
GhostObject->setCollisionFlags(btCollisionObject::CF_CHARACTER_OBJECT);
Character = new btKinematicCharacterController(GhostObject, Capsule, btScalar(0.35));
World->addCollisionObject(GhostObject,btBroadphaseProxy::CharacterFilter, btBroadphaseProxy::StaticFilter|btBroadphaseProxy::DefaultFilter);
World->addAction(Character);
ISceneNode* cube_node = smgr->addCubeSceneNode(1.0f);
cube_node->setScale(vector3df(100.0f));
cube_node->setMaterialTexture(0, driver->getTexture("media/map/Chipped Bricks.jpg"));
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: irrlicht + bullet: character controller
Okay, I don't understand what you are trying to say, none of your sentences are coherent enough for me to even begin figuring out your problem.
I get that your first language isn't English but if you have to use a translator like google translate, it's bound to at least throw something semi-legible at me.
I get that your first language isn't English but if you have to use a translator like google translate, it's bound to at least throw something semi-legible at me.
"this is not the bottleneck you are looking for"
Re: irrlicht + bullet: character controller
To attach scene node to physics body you need to inherit from motion state and update your node positions from it.
It's all explained in bullet wiki, please look through all of those examples before you go any further.
It's all explained in bullet wiki, please look through all of those examples before you go any further.
Working on game: Marrbles (Currently stopped).
Re: irrlicht + bullet: character controller
I understand that the translator is very bad, but I figured out how to make a node that she would inherit the position of the phantom of the capsules. Post the code, but here's the problem, Ghost flies through objects, dynamic he pushes and static passes on through. Shoot a video and posted on YouTube. Please help
The following code in the main loop
http://youtu.be/xQL3FDcP_m8
Code: Select all
btTransform startTransform;
startTransform.setIdentity();
startTransform.setOrigin(btVector3(0.0f, 300.0f, 0.0f));
GhostObject = new btPairCachingGhostObject();
GhostObject->setWorldTransform(startTransform);
Capsule = new btCapsuleShape(100, 200);
GhostObject->setCollisionShape(Capsule);
GhostObject->setCollisionFlags(btCollisionObject::CF_CHARACTER_OBJECT);
Character = new btKinematicCharacterController(GhostObject, Capsule, btScalar(0.35));
World->addCollisionObject(GhostObject, btBroadphaseProxy::CharacterFilter, btBroadphaseProxy::StaticFilter|btBroadphaseProxy::DefaultFilter);
World->addAction(Character);
player_model_node = smgr->addCubeSceneNode(1.0f);
player_model_node->setScale(vector3df(100.0f));
player_model_node->setMaterialTexture(0, driver->getTexture("media/map/Chipped Bricks.jpg"));
player_model_node->setPosition(vector3df(0, 0, 0));
Code: Select all
btTransform my_trans;
my_trans = GhostObject->getWorldTransform();
matrix4 matr;
my_trans.getOpenGLMatrix(matr.pointer());
player_model_node->setPosition(matr.getTranslation());
-
- Posts: 1010
- Joined: Mon Oct 24, 2011 10:03 pm
- Location: 0x45 61 72 74 68 2c 20 69 6e 20 74 68 65 20 73 6f 6c 20 73 79 73 74 65 6d
Re: irrlicht + bullet: character controller
Okay, so.. you want the white balls to go through the cube?
I still don't really get what your problem is, I assume the cube is supposed to go through the ground
I still don't really get what your problem is, I assume the cube is supposed to go through the ground
"this is not the bottleneck you are looking for"
Re: irrlicht + bullet: character controller
did you try using addRigidBody instead of addCollisionObject?
Working on game: Marrbles (Currently stopped).