Several Questions

Discuss any questions about BEPUphysics or problems encountered.
lareusoular
Posts: 40
Joined: Mon Sep 06, 2010 9:22 pm

Re: Several Questions

Post by lareusoular »

Ah, and just one more thing:
how can I do a TriangleMesh here?
I have created a TriangleMesh, but I don't know how to make it an entity... searching....

EDIT: How can I make a Dynamic Triangle Group? Static isn't usefull...
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Several Questions

Post by Norbo »

Currently, the best option is a CompoundBody. Using lots of bodies in a single compound body should be avoided if possible, so if you can, making the shape out of a combination of fewer, simpler convex shapes like ConvexHulls or other primitives would work better.

v0.15.0 includes some significant redesigns that make dynamic triangle meshes more feasible. If they aren't included in v0.15.0, they'll be in the following version.
lareusoular
Posts: 40
Joined: Mon Sep 06, 2010 9:22 pm

Re: Several Questions

Post by lareusoular »

Norbo wrote:Currently, the best option is a CompoundBody. Using lots of bodies in a single compound body should be avoided if possible, so if you can, making the shape out of a combination of fewer, simpler convex shapes like ConvexHulls or other primitives would work better.

v0.15.0 includes some significant redesigns that make dynamic triangle meshes more feasible. If they aren't included in v0.15.0, they'll be in the following version.
Ok, it works, but if I make a more complicated Model, it doesn't... Is there a way to make a concave mesh?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Several Questions

Post by Norbo »

The CompoundBody is just a combination of other Entities. It lets you make concave shapes from other convex ones, including triangles.
lareusoular
Posts: 40
Joined: Mon Sep 06, 2010 9:22 pm

Re: Several Questions

Post by lareusoular »

Norbo wrote:The CompoundBody is just a combination of other Entities. It lets you make concave shapes from other convex ones, including triangles.
ok,

but, there's another problem:
I made a PhysicCamera class. I put it in my editor, it falls and collide with the ground :D, but there is a problem. If I apply a Velocity, the Box(i'm using a box for the camera collision, with heigh 5, width and lenght 1), the object falls some 4 units, and rotate a little... What is happening?
I use:
public Vector3 Velocity
{
set { Box.Entity.ApplyLinearImpulse(value); }
}

What is going on?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Several Questions

Post by Norbo »

Dynamic objects are expected to undergo some angular motion when they collide, depending on the collision. An entity cannot change its angular momentum unless there is some external application of force, so it has to be coming from somewhere.

If you want to prevent something from rotating completely, one option is to set its LocalInertiaTensorInverse to Toolbox.ZeroMatrix. This has the effect of giving the entity infinite inertia and no force can change its orientation.

Note that you can set Velocity properties directly, and that using ApplyLinearImpulse doesn't directly change velocity- it changes momentum, which is a scaling factor (mass) different from velocity. If your object's mass is something other than 1, a linear impulse is not equivalent to a direct change in velocity.
lareusoular
Posts: 40
Joined: Mon Sep 06, 2010 9:22 pm

Re: Several Questions

Post by lareusoular »

So, now I'm using:

public Vector3 Velocity
{
set
{
Box.Entity.LinearVelocity = value;
}
}

It works, but when I use it, the gravity gets strange(the gravity seems to be 0,01, the object falls REALLY slow....)... Without changing it, the object falls fast....
lareusoular
Posts: 40
Joined: Mon Sep 06, 2010 9:22 pm

Re: Several Questions

Post by lareusoular »

lareusoular wrote:So, now I'm using:

public Vector3 Velocity
{
set
{
Box.Entity.LinearVelocity = value;
}
}

It works, but when I use it, the gravity gets strange(the gravity seems to be 0,01, the object falls REALLY slow....)... Without changing it, the object falls fast....

Forget it, it was just a problem with my Visual Script Editor... ok?
lareusoular
Posts: 40
Joined: Mon Sep 06, 2010 9:22 pm

Re: Several Questions

Post by lareusoular »

Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Several Questions

Post by Norbo »

Looking good :)
lareusoular
Posts: 40
Joined: Mon Sep 06, 2010 9:22 pm

Re: Several Questions

Post by lareusoular »

Norbo wrote:Looking good :)
Thanks
Post Reply