Search found 249 matches

by Spankenstein
Sun Jun 10, 2012 9:17 pm
Forum: Questions and Help
Topic: How can I implement better collision detection for rolling?
Replies: 21
Views: 11581

Re: How can I implement better collision detection for rolli

Also, the extra contacts list could be eliminated by combining the loops unless you had some other need for it. Not at this point. It might be useful for filtering contacts in the future. By combining the loops I presume you were suggesting using a double loop? float dot; int numContacts; int numPa...
by Spankenstein
Sun Jun 10, 2012 8:54 pm
Forum: Questions and Help
Topic: How can I implement better collision detection for rolling?
Replies: 21
Views: 11581

Re: How can I implement better collision detection for rolli

You may find that using the contact RelativeVelocity dotted with the contact normal produces more intuitive results The '0.1f' value will be tweaked but is this looking correct? I presumed the absolute value would be required. // Gather all contacts for this frame int numPairs = entity.CollisionInf...
by Spankenstein
Sun Jun 10, 2012 8:24 pm
Forum: Questions and Help
Topic: How can I implement better collision detection for rolling?
Replies: 21
Views: 11581

Re: How can I implement better collision detection for rolli

NormalImpulses will scale with the involved objects' masses and relative velocity Would it work to scale based on ranges for unit mass and unit velocity? So in other words if I knew the ignorable impulse range for two objects with a mass of 1 and velocity whose length is 1 then I can multiply that ...
by Spankenstein
Sun Jun 10, 2012 8:04 pm
Forum: Questions and Help
Topic: How can I implement better collision detection for rolling?
Replies: 21
Views: 11581

Re: How can I implement better collision detection for rolli

Thanks Norbo, I'll code a bit more knowing I'm on the right track. Just using some contact list analysis will likely be more natural and convenient. Which event should I hook up for this purpose? If the goal is to trigger whenever a fairly strong impact is detected, regardless of which object is ass...
by Spankenstein
Sun Jun 10, 2012 7:07 pm
Forum: Questions and Help
Topic: How can I implement better collision detection for rolling?
Replies: 21
Views: 11581

How can I implement better collision detection for rolling?

I would like to implement collision detection for an object that ignores rolling and requires a certain impact force in order to register. I'm currently overriding the 'Events_InitialCollisionDetected' method, is this the best one to use? protected override void Events_InitialCollisionDetected(Entit...
by Spankenstein
Fri Jun 01, 2012 11:14 pm
Forum: Questions and Help
Topic: TriangleShape RayTest method with compound bodies.
Replies: 6
Views: 4017

Re: TriangleShape RayTest method with compound bodies.

Excellent stuff, the ToolBox method is a great idea. for (int t = 0; t < numTriangles; ++t) { TriangleShape tri = compoundBody.Shapes[t].Shape as TriangleShape; Matrix m = compoundBody.Shapes[t].LocalTransform.Matrix * compoundBody.WorldTransform; Vector3 a = Vector3.Transform(tri.VertexA, m); Vecto...
by Spankenstein
Fri Jun 01, 2012 10:56 pm
Forum: Questions and Help
Topic: TriangleShape RayTest method with compound bodies.
Replies: 6
Views: 4017

Re: TriangleShape RayTest method with compound bodies.

The problem is that the triangles have to be DoubleSided as they belong to a hollow mesh that should constrain objects inside and react to objects outside. The ray cast route is probably the only viable option then?

I apologise I should have mentioned this before.
by Spankenstein
Fri Jun 01, 2012 10:18 pm
Forum: Questions and Help
Topic: TriangleShape RayTest method with compound bodies.
Replies: 6
Views: 4017

Re: TriangleShape RayTest method with compound bodies.

However, this sort of sidedness calculation is automatic if you use a MobileMesh and pick Clockwise or Counterclockwise for the sidedness. I would like to calculate the contact normal to do a dot product with the camera forward (same as camera culling). I don't think the sidedness can help with thi...
by Spankenstein
Fri Jun 01, 2012 8:57 pm
Forum: Questions and Help
Topic: TriangleShape RayTest method with compound bodies.
Replies: 6
Views: 4017

TriangleShape RayTest method with compound bodies.

I'm performing a ray test against every triangle in a compound body in order to ignore those that are intersected but are facing away from the camera (i.e. culled) // Test ray against all triangles that make up the hollow object var compoundBody = hollowObject.Entity as CompoundBody; int numTriangle...
by Spankenstein
Fri Jun 01, 2012 4:08 pm
Forum: Questions and Help
Topic: 'GravitationalField' - How do I get the field to ignore?
Replies: 4
Views: 2848

Re: 'GravitationalField' - How do I get the field to ignore?

changing it to a single direct entity equality test would probably be marginally faster Good point: public class InfiniteForceFieldShapeCustom : ForceFieldShape { public Entity owner; public InfiniteForceFieldShapeCustom(Entity owner) { this.owner = owner; } /// <summary> /// Determines the possibl...
by Spankenstein
Fri Jun 01, 2012 3:26 pm
Forum: Questions and Help
Topic: 'GravitationalField' - How do I get the field to ignore?
Replies: 4
Views: 2848

Re: 'GravitationalField' - How do I get the field to ignore?

Thanks Norbo. So something like this wouldn't be too bad an implementation I hope: public override bool IsEntityAffected(Entity testEntity) { var o = testEntity.CollisionInformation.Tag as GravitationalFieldPrimitive; return o == null ? true : false; } Also, the new version (1.2.0) is great! :)
by Spankenstein
Fri Jun 01, 2012 9:52 am
Forum: Questions and Help
Topic: 'GravitationalField' - How do I get the field to ignore?
Replies: 4
Views: 2848

'GravitationalField' - How do I get the field to ignore?

I have an entity associated with a GravitationalField class. This means that I have a kinematic or dynamic model that denotes the origin of the field. The entity is there so it can be interacted with via a GUI. The position of the GravitationalField is always at the centroid of the associated entity...
by Spankenstein
Fri Sep 30, 2011 8:26 pm
Forum: Questions and Help
Topic: Is there a built in way to limit entity velocities?
Replies: 3
Views: 2697

Re: Is there a built in way to limit entity velocities?

though if you want a limit, it would only correct it if over the maximum velocity, and it needs to protect against zero velocity NaN's I could always use LengthSquared and put the sign back in afterwards; saves a square root calculation. Would also make it easier to protect against zero velocity wi...
by Spankenstein
Fri Sep 30, 2011 8:23 pm
Forum: Questions and Help
Topic: FluidVolume surface triangles. Are they always coplanar?
Replies: 3
Views: 2652

Re: FluidVolume surface triangles. Are they always coplanar

I am not sure when or if I'll get around to actually releasing such a feature; I try to balance features with how useful they end up being. Game-usable fracture simulation and other things are more valuable at this point.
That's cool. I'll focus my attention elsewhere when using the engine. :)
by Spankenstein
Fri Sep 30, 2011 12:23 pm
Forum: Questions and Help
Topic: FluidVolume surface triangles. Are they always coplanar?
Replies: 3
Views: 2652

FluidVolume surface triangles. Are they always coplanar?

When using a FluidVolume to represent some fluid in a container there seems to be no change to the SurfaceTriangle vertices when objects are thrown in the water. Is this something that you have considered adding to BEPU at some point? No response occurs if I were to grab an object containing a Fluid...