ConstantAngularSpeedCurve ?

Discuss any questions about BEPUphysics or problems encountered.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: ConstantAngularSpeedCurve ?

Post by Norbo »

I have bugs when I used Heights for my Heightmap.
What kind of bugs? There are no known problems with the Terrain object, even for quite large datasets; if you are seeing problems with physics, I'd like to hear about them.

If you're seeing graphical errors, it may be related to using 16 bit shorts for indices rather than 32 bit ints. If you overflow the indices, parts of the model will tend to disappear and you may see errant triangles stretching all over the place.
But I want to know if a StaticMesh ( from model ) has a high cost for collision test ?
The terrain has constant access time for nearby triangles. A static mesh has logarithmic access time. They're both very fast in practice, but terrain does have a slight advantage algorithmically. The constant factors are important at most game-relevant scales, though- measuring the performance of both options in your use case would be a good idea.
kavatortank
Posts: 91
Joined: Tue May 14, 2013 12:17 pm

Re: ConstantAngularSpeedCurve ?

Post by kavatortank »

Here http://imageshack.us/photo/my-images/835/hmbugger.png/ is a picture which represent the heighmap draw by bepuDrawer
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: ConstantAngularSpeedCurve ?

Post by Norbo »

The BEPUphysicsDrawer uses 16 bit indices, so that's an expected graphical failure.

To emphasize, the physics are not affected by this problem at all; it is solely a graphical issue.
kavatortank
Posts: 91
Joined: Tue May 14, 2013 12:17 pm

Re: ConstantAngularSpeedCurve ?

Post by kavatortank »

Re,
I did the integration of the bepuphysics engine, that means that the physics works well and the graphics is the bepudrawer.
But I want to use my graphics engine now.
I've got 2 problems.
This work is complicated.
And my tank ( graphic ) does not match the physical model, so how can I create the tank physical model with my graphical model ?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: ConstantAngularSpeedCurve ?

Post by Norbo »

so how can I create the tank physical model with my graphical model ?
Going from slow and accurate to fast and approximate:
1) Create a MobileMesh for each independent part of the tank based on the graphical model. This will be relatively slow, particularly if your graphical mesh is highly detailed. (See MobileMeshDemo.)

2) Same as #1, but use a simplified collision mesh as the MobileMesh source.

3) Create a set of a few convex hull shapes representing parts of the tank based on the graphical model. If desired, you can bundle multiple convex hull shapes into one rigid entity using a compound body to have concavity. Convex hull collision detection performance depends on the number of vertices on the convex surface. (See EntityConstructionDemo.)

4) Same as #3, but use a simplified collision mesh as the source of the hull.

5) Create a set of a few primitive shapes, like BoxShapes, representing parts of the tank. If desired, you can bundle multiple primitive shapes into one rigid entity using a compound body to have concavity. (See CompoundBodiesDemo and EntityConstructionDemo.)

All of the above, apart from the slowest MobileMesh option, require some degree of approximation and fiddly labor. If an artist needs to make a lot of these collision models, it would probably be worth it to set up a pipeline which allows them to define collision shapes at content building time within some handy tools rather than doing it by hand in code.

Finally, an important note: the origin of the model will often be different than the center of mass of the resulting shape, especially in complex shape types like the ConvexHullShape, CompoundShape, and MobileMeshShape. In this case, you must be aware of shape recentering. Otherwise, the graphical model will probably end up offset in local space from the collision shape.
kavatortank
Posts: 91
Joined: Tue May 14, 2013 12:17 pm

Re: ConstantAngularSpeedCurve ?

Post by kavatortank »

Hum, I didn't understand why you say that.
I was talking about the creation of the tank. As in my tankInput, we created the tank but knowing the proportions of each wheel, hull, turret, gun, etc ... But I want to create this tank with the different graphical portion of my tank. In tankinput, for example wheels, placing the anchor has a point, but I would like placed in the fct graph model, you understand?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: ConstantAngularSpeedCurve ?

Post by Norbo »

I was talking about the creation of the tank. As in my tankInput, we created the tank but knowing the proportions of each wheel, hull, turret, gun, etc ... But I want to create this tank with the different graphical portion of my tank. In tankinput, for example wheels, placing the anchor has a point, but I would like placed in the fct graph model, you understand?
If you're asking how to put the wheels in the right spot or how to choose the dimensions in general based on a graphical model, there is no trick to it. The direct (but impractical given many models) option is to fiddle with things by trial and error.

A more scalable approach is to create that information when the model is actually being made in the modelling program by the artist. The artist includes data in the model which tells the game's content processor where wheels are, what the dimensions of shapes are, and everything else. There's nothing in BEPUphysics to help with this strictly content-side process; it depends entirely on whatever process you choose to use.

If you're asking something else, then I am still missing it.
kavatortank
Posts: 91
Joined: Tue May 14, 2013 12:17 pm

Re: ConstantAngularSpeedCurve ?

Post by kavatortank »

BepuPhysics have a plugin to create compoundbodies with a graphical interface ?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: ConstantAngularSpeedCurve ?

Post by Norbo »

Nope; BEPUphysics sticks to core functionality and avoids content side things for the most part (with the exception of bepuik). Maybe one day such a thing will exist, but I wouldn't count on it.
kavatortank
Posts: 91
Joined: Tue May 14, 2013 12:17 pm

Re: ConstantAngularSpeedCurve ?

Post by kavatortank »

When I add a box to the current space, this box is draw on the screen by the bepudrawer, but I don't want. How I can remove it ? Because when I write ModelDrawer.Remover(box), this don't work.
Tks.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: ConstantAngularSpeedCurve ?

Post by Norbo »

Removing it should work, but it can also be avoided by not adding the entity to the ModelDrawer to begin with. The ModelDrawer only draws what it is given; it doesn't automatically grab stuff from the space.
kavatortank
Posts: 91
Joined: Tue May 14, 2013 12:17 pm

Re: ConstantAngularSpeedCurve ?

Post by kavatortank »

I tought that too, but when I write that :

Code: Select all

turret2 = new Box(turret.Position + new Vector3(0, 2, -3.5f), .5f, .5f, 4, 100);
Space.Add(turret2);
The turret2 is draw on the screen...

EDIT :

Also in the tankInput, when you do that Space.Add(Vehicle); the body of the vehicle is draw on the screen
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: ConstantAngularSpeedCurve ?

Post by Norbo »

In the BEPUphysicsDemos, entities are explicitly added by a loop that executes after simulation configuration. From the DemosGame:

Code: Select all

            foreach (Entity e in currentSimulation.Space.Entities)
            {
                if ((string)e.Tag != "noDisplayObject")
                {
                    ModelDrawer.Add(e);
                }
                else //Remove the now unnecessary tag.
                    e.Tag = null;
            }
kavatortank
Posts: 91
Joined: Tue May 14, 2013 12:17 pm

Re: ConstantAngularSpeedCurve ?

Post by kavatortank »

AHAH okay, great.
And I have a question.
Is there are any trick to have a "compound body", and each part of the compound body can be modify, with rotation ?
Because my constraints do bad tricks lol
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: ConstantAngularSpeedCurve ?

Post by Norbo »

Compound shapes are designed to be immutable. Changing the shape requires creating a new one. Any change would also be a teleportation as opposed to a physical operation, causing problems with collision response. I wouldn't recommend doing this.

You could also teleport an entity around to follow another entity, but there would be no physical connection between the two so collision response would be doubly broken. In that case, it would be better to just use a strictly graphical attachment instead of a physical one.

If you want a physical connection, then constraints are the correct choice.
Post Reply