irrBullet 0.1.8 - Bullet physics wrapper
-
- Posts: 47
- Joined: Mon Jan 10, 2011 8:01 pm
- Location: SoCal
alright,
update:
I changed the ground mesh over into an IBoxShape from a IBvhTriangleMeshShape and the simulation had no lag whatsoever, even when using the original mesh for the falling object in stead of an optimized one. Then I realized that the problem was with using IBvhTriangleMeshShape, so I switched the ground mesh over into an IGImpactMeshShape in stead and that one worked out just fine.
Quick question:
If I use IGImpactMeshShape for both static and dynamic meshes without using IBvhTriangleMeshShape for anything, will I encounter any problems later on? Or can I use IGImpact for pretty much all the whole thing?
update:
I changed the ground mesh over into an IBoxShape from a IBvhTriangleMeshShape and the simulation had no lag whatsoever, even when using the original mesh for the falling object in stead of an optimized one. Then I realized that the problem was with using IBvhTriangleMeshShape, so I switched the ground mesh over into an IGImpactMeshShape in stead and that one worked out just fine.
Quick question:
If I use IGImpactMeshShape for both static and dynamic meshes without using IBvhTriangleMeshShape for anything, will I encounter any problems later on? Or can I use IGImpact for pretty much all the whole thing?
Unless you have an insane amount of geometry for the collision shapes you should not have a problem with the IBvhTriangleMeshShape.Whirled Peas wrote:alright,
update:
I changed the ground mesh over into an IBoxShape from a IBvhTriangleMeshShape and the simulation had no lag whatsoever, even when using the original mesh for the falling object in stead of an optimized one. Then I realized that the problem was with using IBvhTriangleMeshShape, so I switched the ground mesh over into an IGImpactMeshShape in stead and that one worked out just fine.
Quick question:
If I use IGImpactMeshShape for both static and dynamic meshes without using IBvhTriangleMeshShape for anything, will I encounter any problems later on? Or can I use IGImpact for pretty much all the whole thing?
You might want to try a different mesh format to load them as well. See Dark Dragon's problem in the previous couple pages.
I suggest you fix this problem and use the IBvhTriangleMeshShape for static meshes instead of a static IGImpactMeshShape because the IBvhTriangleMeshShape is optimized for static geometry.
http://en.wikipedia.org/wiki/Bounding_volume_hierarchy
In my game I have a lot of geometry with many IGImpactMeshShapes and IBvhTriangleMeshShapes and there's no problem at all.
Both will affect performance, but a lot of triangle mesh geometry for the collision shapes can slow down performance a lot more than rendering.Whirled Peas wrote:ok, so is performance more affected by the per mesh poly count on collision meshes? Or is it more the overall poly count for the entire scene?
When Bullet does a narrowphase collision check on triangle meshes, it has to check collisions for the whole mesh, and meshes against meshes, so you can imagine why it'd be slow if you don't optimize properly.
-
- Posts: 24
- Joined: Fri Nov 05, 2010 11:46 pm
Quick question, do you think that that Kinematic player controller will be implemented at some point? I'd implement it's functionality myself, but I'm very new to this type of stuff and have no clue how to do it. I'm writing a game engine of sorts for personal use, and it would be pretty awesome to have controllable players.
Last time I checked out the kinematic controller on the bullet it self it was a little crappy, instead I made my own controller with dynamic rygid body. Not sure if it's worth to implement.Dark Dragon DX wrote:Quick question, do you think that that Kinematic player controller will be implemented at some point? I'd implement it's functionality myself, but I'm very new to this type of stuff and have no clue how to do it. I'm writing a game engine of sorts for personal use, and it would be pretty awesome to have controllable players.
Working on game: Marrbles (Currently stopped).
-
- Posts: 24
- Joined: Fri Nov 05, 2010 11:46 pm
Darn, I can do the code for pretty much everything else except Player objects ... I can probably hack a player object by using a cube and applying impulses to move forward, backward, left, right, ect & other impulses to correct the angle? (Don't want to be falling down stairs lol)serengeor wrote:Last time I checked out the kinematic controller on the bullet it self it was a little crappy, instead I made my own controller with dynamic rygid body. Not sure if it's worth to implement.Dark Dragon DX wrote:Quick question, do you think that that Kinematic player controller will be implemented at some point? I'd implement it's functionality myself, but I'm very new to this type of stuff and have no clue how to do it. I'm writing a game engine of sorts for personal use, and it would be pretty awesome to have controllable players.
Or perhaps one can use the animators in Irrlicht to simulate gravity and have a Bullet collision mesh following along? So that way bullet objects cannot affect the player, but the player can affect bullet objects (most likely some coding will be needed if you want the player to be able to walk into stuff and nudging objects as a result)
Hm, what I had made was a simple rigid box that was aligned with dwarf's center using bounding box, and then the mesh was updated according to rigid box position and rotation, also I made it not to fall on sides, tough It could be affected by other physics bodies as I think its more fun that way
Working on game: Marrbles (Currently stopped).
Dark Dragon DX:
Sometimes a character controller is dependent on the game, so I probably won't have one for a while. I've got a lot of other projects to work on, and other priorities for irrBullet's future.
You can find one of my previous posts that states how to keep an object upright.
I'll also add this and similar things to the FAQ for the next release.
- Josiah
Sometimes a character controller is dependent on the game, so I probably won't have one for a while. I've got a lot of other projects to work on, and other priorities for irrBullet's future.
You can find one of my previous posts that states how to keep an object upright.
I'll also add this and similar things to the FAQ for the next release.
- Josiah
-
- Posts: 24
- Joined: Fri Nov 05, 2010 11:46 pm
I was aiming for a simple FPS/TPS player controller. But I'll check to see if I can get a physics object to work as such.cobra wrote:Dark Dragon DX:
Sometimes a character controller is dependent on the game, so I probably won't have one for a while. I've got a lot of other projects to work on, and other priorities for irrBullet's future.
You can find one of my previous posts that states how to keep an object upright.
I'll also add this and similar things to the FAQ for the next release.
- Josiah
-
- Posts: 47
- Joined: Mon Jan 10, 2011 8:01 pm
- Location: SoCal
When talking about a kinematic player controller, do you mean that the game translates player inputs into force and torque inputs to orient and move the player character as opposed to direct rotation and movement inputs?
If so, that's what I'm working on right now, I was just going to have the game take user inputs from the keyboard in the form of WASD keys which turns on "propulsion" forces, and mouse movement which gets translated into torque forces to turn the player character around.
I am wondering however, is there a built in function which causes a rigid body to slow down within like a half second to a second after releasing the "accelerate" key as well as stopping the player from turning around once the mouse stops moving? Perhaps something that simulates air or water resistance in a simplistic fashion?
If not I was thinking of adding in a function that eases off of the "propulsion force" the longer the key is held down in order to set up a maximum velocity, and then another one which automatically hits the player character with a counter force to slow down the player character to a halt within a very short time of the key being released.
Also, I am also interested on working on an "artificial gravity" system whereby a certain game level can have multiple "down" directions. So depending on where on a game map an object is located it will "fall" in a different direction. I'm guessing that Bullet only supports gravity going in one direction at one time for the entire "world" correct?
If that is the case I was thinking of turning gravity off altogether and in stead using a bunch of "gravity generators" which would typically take the form of planes and spheres which would pull any rigid body towards it once said rigid body gets within a "zone of influence".
Not sure if I should just use a script that merely applies a force to any body under the influence of these gravity generators or simply use attractors.
If so, that's what I'm working on right now, I was just going to have the game take user inputs from the keyboard in the form of WASD keys which turns on "propulsion" forces, and mouse movement which gets translated into torque forces to turn the player character around.
I am wondering however, is there a built in function which causes a rigid body to slow down within like a half second to a second after releasing the "accelerate" key as well as stopping the player from turning around once the mouse stops moving? Perhaps something that simulates air or water resistance in a simplistic fashion?
If not I was thinking of adding in a function that eases off of the "propulsion force" the longer the key is held down in order to set up a maximum velocity, and then another one which automatically hits the player character with a counter force to slow down the player character to a halt within a very short time of the key being released.
Also, I am also interested on working on an "artificial gravity" system whereby a certain game level can have multiple "down" directions. So depending on where on a game map an object is located it will "fall" in a different direction. I'm guessing that Bullet only supports gravity going in one direction at one time for the entire "world" correct?
If that is the case I was thinking of turning gravity off altogether and in stead using a bunch of "gravity generators" which would typically take the form of planes and spheres which would pull any rigid body towards it once said rigid body gets within a "zone of influence".
Not sure if I should just use a script that merely applies a force to any body under the influence of these gravity generators or simply use attractors.
Whirled Peas wrote:When talking about a kinematic player controller, do you mean that the game translates player inputs into force and torque inputs to orient and move the player character as opposed to direct rotation and movement inputs?
If so, that's what I'm working on right now, I was just going to have the game take user inputs from the keyboard in the form of WASD keys which turns on "propulsion" forces, and mouse movement which gets translated into torque forces to turn the player character around.
I am wondering however, is there a built in function which causes a rigid body to slow down within like a half second to a second after releasing the "accelerate" key as well as stopping the player from turning around once the mouse stops moving? Perhaps something that simulates air or water resistance in a simplistic fashion?
If not I was thinking of adding in a function that eases off of the "propulsion force" the longer the key is held down in order to set up a maximum velocity, and then another one which automatically hits the player character with a counter force to slow down the player character to a halt within a very short time of the key being released.
Also, I am also interested on working on an "artificial gravity" system whereby a certain game level can have multiple "down" directions. So depending on where on a game map an object is located it will "fall" in a different direction. I'm guessing that Bullet only supports gravity going in one direction at one time for the entire "world" correct?
If that is the case I was thinking of turning gravity off altogether and in stead using a bunch of "gravity generators" which would typically take the form of planes and spheres which would pull any rigid body towards it once said rigid body gets within a "zone of influence".
Not sure if I should just use a script that merely applies a force to any body under the influence of these gravity generators or simply use attractors.
Kinematic controllers are the opposite of what you described. It is non-rigidbody.
For dynamic character controllers you would typically set the angular and linear velocities absolutely. As in, not applying forces to induce movement.
Changing gravity direction for an individual collision object is easy. You can just use IRigidBody::setGravity().
With one of the next irrBullet releases this will be easier, because I'll be introducing a "trigger" interface, from which the developer can derive his own class to manipulate each penetrating object.
I'm sorry about the short answer. I can't make a longer one right now.
- Josiah
-
- Posts: 47
- Joined: Mon Jan 10, 2011 8:01 pm
- Location: SoCal
nice work on 1.7.1 release. Its nice that you add bullet to your release but maybe some people wanna use it with a different version of bullet. like me. maybe make bullet use the global var system as well so someone can easily exchange bullet by setting their own global without having to change your project file.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Whirled Peas wrote:Oh, no problem with the length of your answer
ok, yeah, that sounds simpler than my idea, I'll probably go with that in stead. Question: For setting the orientation of the character mesh you just use the IrrBullet equivalent of "SetAngularVelocity" right?
If it's a FPS game, then you can keep the character rotation static and just set the linear velocity in the direction your FPS camera is pointing, multiplied by the speed you want.
After you multiply the vector by the speed, you should zero-out the Y axis so you can't fly up or down, but only move along the XZ plane.
@Sudi:
Thank you. I will do that for the next release.
- Josiah
-
- Posts: 47
- Joined: Mon Jan 10, 2011 8:01 pm
- Location: SoCal
you do that by positioning your rigid body, basically I think every frame your mesh is updated by bullets rigid body, so no matter what you set your mesh's position/rotation it will get the position and rotation from the rigid body.Whirled Peas wrote:I recently found out that you can't use setPosition on a meshNode once it has had a rigidbody attached to it. Is there a way to set the position of the meshnode according to coordinates after creating a rigidbody for the meshnode?
Just try to do
Code: Select all
///pseudo code
myrigidbody->setPosition(mypos);
Working on game: Marrbles (Currently stopped).