dont add contact joints for geom-geom
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2025-05-30 15:08:20 -04:00
parent cc40718f42
commit f2c0a799e9
2 changed files with 13 additions and 25 deletions

View File

@ -2079,6 +2079,7 @@ Render pathing nodes (still needs some work)
Pathing construction between town buildings and road nodes
Pathing construction for farm plots
Bounding sphere work
Don't allocate contact joints for geom-geom

View File

@ -497,34 +497,21 @@ public class CollisionEngine {
continue;
}
// //
// //apply shallow slope correction
// if(
// //is terrain
// (c1.getType() == Collidable.TYPE_TERRAIN || c2.getType() == Collidable.TYPE_TERRAIN) &&
// (!c1.getType().equals(c2.getType())) &&
// contact.geom.normal.length() > 0
// &&
// //force is pointing basically upwards
// PhysicsUtils.odeVecToJomlVec(contact.geom.normal).dot(MathUtils.getUpVector()) > 0.7
// ){
// System.out.println(PhysicsUtils.odeVecToJomlVec(contact.geom.normal).dot(MathUtils.getUpVector()));
// if(//force is pointing basically upwards
// PhysicsUtils.odeVecToJomlVec(contact.geom.normal).dot(MathUtils.getUpVector()) > 0.7){
// contact.geom.normal.set(PhysicsUtils.jomlVecToOdeVec(MathUtils.getUpVector()));
// }
// }
//
//add contact to contact group
DJoint c = OdeHelper.createContactJoint(world,contactgroup,contact);
if(b1 == null){
if(b2 == null){
} else {
c.attach(null,b2);
} else if(b2 == null){
}
} else {
if(b2 == null){
c.attach(b1,null);
} else {
c.attach(b1,b2);
}
}
// Use the default collision resolution
if(collisionResolutionCallback == null) {