Several Questions
-
- Posts: 40
- Joined: Mon Sep 06, 2010 9:22 pm
Re: Several Questions
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...
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...
Re: Several Questions
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.
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.
-
- Posts: 40
- Joined: Mon Sep 06, 2010 9:22 pm
Re: Several Questions
Ok, it works, but if I make a more complicated Model, it doesn't... Is there a way to make a concave mesh?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.
Re: Several Questions
The CompoundBody is just a combination of other Entities. It lets you make concave shapes from other convex ones, including triangles.
-
- Posts: 40
- Joined: Mon Sep 06, 2010 9:22 pm
Re: Several Questions
ok,Norbo wrote:The CompoundBody is just a combination of other Entities. It lets you make concave shapes from other convex ones, including triangles.
but, there's another problem:
I made a PhysicCamera class. I put it in my editor, it falls and collide with the ground , 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?
Re: Several Questions
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.
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.
-
- Posts: 40
- Joined: Mon Sep 06, 2010 9:22 pm
Re: Several Questions
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....
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....
-
- Posts: 40
- Joined: Mon Sep 06, 2010 9:22 pm
Re: Several Questions
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?
-
- Posts: 40
- Joined: Mon Sep 06, 2010 9:22 pm
Re: Several Questions
Looking good
-
- Posts: 40
- Joined: Mon Sep 06, 2010 9:22 pm
Re: Several Questions
ThanksNorbo wrote:Looking good