irrBullet 0.1.8 - Bullet physics wrapper
how to move an object without accelerating and decelerating? sorry i'm new to game physics.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Virion:
Code: Select all
irr::matrix4 mat = rigidbody->getWorldTransform();
mat.setTranslation(irr::core::vector3df(20,20,20));
rigidbody->setWorldTransform(mat);
thx for the help cobra. now i'm trying to rotate my object when i pressing a button. it works fine at first but when it reaches 90 degree it won't rotate anymore.
thx in advance
Code: Select all
matrix4 mat = body->getWorldTransform();
vector3df rot = mat.getRotationDegrees();
mat.setRotationDegrees(rot - vector3df(0, 1 * speed, 0));
body->setWorldTransform(mat);
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
Sounds like a gimbal lock to me (an issue that did cost me about a week to workaround in IrrOde).
In IrrOde it works like this: when a Gimbal Lock is detected the Irrlicht scenenode's rotation is not updated (Gimbal locks are a problem of the Euler angles, quaternions don't have such problems).
In IrrOde it works like this: when a Gimbal Lock is detected the Irrlicht scenenode's rotation is not updated (Gimbal locks are a problem of the Euler angles, quaternions don't have such problems).
Dustbin::Games on the web: https://www.dustbin-online.de/
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
it won't work if the body isn't set as kinematic body. In order to move an object "legally" into the bullet world is to set it as kinematic bodycobra wrote:Virion:
Code: Select all
irr::matrix4 mat = rigidbody->getWorldTransform(); mat.setTranslation(irr::core::vector3df(20,20,20)); rigidbody->setWorldTransform(mat);
irrBP - an Irrlicht - Bullet Physics Wrapper.
The only irrlicht-physics wrapper that uses multithread technology.
The only irrlicht-physics wrapper that uses multithread technology.
weird. i set my body to kinematics and it won't work anymore.Zurzaza wrote:it won't work if the body isn't set as kinematic body. In order to move an object "legally" into the bullet world is to set it as kinematic bodycobra wrote:Virion:
Code: Select all
irr::matrix4 mat = rigidbody->getWorldTransform(); mat.setTranslation(irr::core::vector3df(20,20,20)); rigidbody->setWorldTransform(mat);
Code: Select all
body->setCollisionFlags(ECF_KINEMATIC_OBJECT);
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
hmm..it looks very strange.Virion wrote: weird. i set my body to kinematics and it won't work anymore.
then i set it back to character object and it works again. but still the rotation is locked at 90 degree.Code: Select all
body->setCollisionFlags(ECF_KINEMATIC_OBJECT);
From the bullet official manual (p.22), it only says that kinematic bodies can be animated by te user:
So, i can't explain why your object can be movedKinematic rigidbodies: can be animated by the user, but there will be only one-way interaction: dynamic objects will be pushed away but there is no influence from dynamics objects
irrBP - an Irrlicht - Bullet Physics Wrapper.
The only irrlicht-physics wrapper that uses multithread technology.
The only irrlicht-physics wrapper that uses multithread technology.
Zurzaza:
It most certainly can be positioned without first being set to kinematic.
You misunderstood what the documentation says.
Kinematic objects are useful for things like character controllers, because they will affect dynamic objects but will themselves not be affected.
Virion:
I'll have to look in to your problem when I have more time. Sorry.
If you figure it out before then, please let me know.
It most certainly can be positioned without first being set to kinematic.
You misunderstood what the documentation says.
Kinematic objects are useful for things like character controllers, because they will affect dynamic objects but will themselves not be affected.
Virion:
I'll have to look in to your problem when I have more time. Sorry.
If you figure it out before then, please let me know.
-
- Posts: 22
- Joined: Mon Nov 15, 2010 9:18 pm
-
- Posts: 6
- Joined: Sun Sep 05, 2010 3:08 pm
help needed!
---problem solved---
cobra, thanks for so cool wrapper!
cobra, thanks for so cool wrapper!
Last edited by Leo [Teh one] on Sun Nov 21, 2010 6:22 pm, edited 2 times in total.
The problem with this is, that getWorldTransform() returnd wrong rotation. My workaround was, to store the rotation manually in a variable, instead of getting it from the bodyVirion wrote:thx for the help cobra. now i'm trying to rotate my object when i pressing a button. it works fine at first but when it reaches 90 degree it won't rotate anymore.thx in advanceCode: Select all
matrix4 mat = body->getWorldTransform(); vector3df rot = mat.getRotationDegrees(); mat.setRotationDegrees(rot - vector3df(0, 1 * speed, 0)); body->setWorldTransform(mat);
Code: Select all
int RotY= 0;
IRigidBody* Body;
...
void rotate(float degrees)
{
rotY+= degrees;
matrix4 mat= body->getWorldTransform(); //we get the transform, just to get correct translation and won't use the rotation from it
mat.setRotationDegrees(vector3df(0, rotY, 0));
body->setWorldTransform(mat);
}
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
You could also try changing "vector3df rot" from mat.getRotationDegrees() to
I'll fix this for 0.1.7. Apparently copying over OpenGL matrix from Bullet to Irrlicht doesn't have the right rotation, but from Irrlicht to Bullet it does.
Code: Select all
body->getCollisionShape()->getSceneNode()->getAbsoluteTransformation().getRotation()
I'll fix this for 0.1.7. Apparently copying over OpenGL matrix from Bullet to Irrlicht doesn't have the right rotation, but from Irrlicht to Bullet it does.
Problem compiling
This files gives me trouble in Softbody.h:
#include <map.h>
#include <vector.h>
Both files seems to be missing, maybe i did something wrong?
This happens to me with 1.65 only.
#include <map.h>
#include <vector.h>
Both files seems to be missing, maybe i did something wrong?
This happens to me with 1.65 only.
The sleeper must awaken!
Re: Problem compiling
Birdman wrote:This files gives me trouble in Softbody.h:
#include <map.h>
#include <vector.h>
Both files seems to be missing, maybe i did something wrong?
This happens to me with 1.65 only.
Change map.h to just map, and vector.h to just vector.
This is already fixed for 0.1.7, which will be out by January 5th.