small collision engine formatting
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
8147a21f2d
commit
85f0652d4f
@ -1239,6 +1239,7 @@ Store terrain chunk files in dedicated folder
|
||||
Start to standardize on doubles for positional data
|
||||
Fix placing character at end of world bounds
|
||||
Bump ode4j version
|
||||
Small collision engine code formatting
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,13 +1,5 @@
|
||||
package electrosphere.collision;
|
||||
|
||||
// import static org.ode4j.ode.OdeConstants.dContactBounce;
|
||||
// import static org.ode4j.ode.OdeConstants.dContactSoftCFM;
|
||||
// import static org.ode4j.ode.OdeConstants.dInfinity;
|
||||
import static org.ode4j.ode.OdeHelper.areConnectedExcluding;
|
||||
// import static org.ode4j.ode.OdeMath.dCalcVectorLengthSquare3;
|
||||
// import static org.ode4j.ode.OdeMath.dSubtractVectors3;
|
||||
// import static org.ode4j.ode.internal.Common.dRecip;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
@ -146,11 +138,11 @@ public class CollisionEngine {
|
||||
*/
|
||||
public CollisionEngine(){
|
||||
world = OdeHelper.createWorld();
|
||||
space = OdeHelper.createBHVSpace(Collidable.TYPE_STATIC_BIT);
|
||||
world.setGravity(0,-GRAVITY_MAGNITUDE,0);
|
||||
space = OdeHelper.createBHVSpace(Collidable.TYPE_STATIC_BIT);
|
||||
// world.setContactMaxCorrectingVel(0.1);
|
||||
// world.setContactSurfaceLayer(0.001);
|
||||
world.setCFM(1e-5);
|
||||
// world.setCFM(1e-10);
|
||||
|
||||
//base plane
|
||||
OdeHelper.createPlane(space, 0, 1, 0, 0);
|
||||
@ -313,13 +305,13 @@ public class CollisionEngine {
|
||||
* @param o1 the first collision body
|
||||
* @param o2 the second collision body
|
||||
*/
|
||||
private void nearCallback (Object data, DGeom o1, DGeom o2) {
|
||||
private void nearCallback(Object data, DGeom o1, DGeom o2){
|
||||
// if (o1->body && o2->body) return;
|
||||
|
||||
// exit without doing anything if the two bodies are connected by a joint
|
||||
DBody b1 = o1.getBody();
|
||||
DBody b2 = o2.getBody();
|
||||
if (b1!=null && b2!=null && areConnectedExcluding (b1,b2,DContactJoint.class)){
|
||||
if(b1 != null && b2 != null && OdeHelper.areConnectedExcluding(b1,b2,DContactJoint.class)){
|
||||
return;
|
||||
}
|
||||
|
||||
@ -682,7 +674,6 @@ public class CollisionEngine {
|
||||
if(bodies.size() > COLLIDABLE_COUNT_WARNING_THRESHOLD){
|
||||
LoggerInterface.loggerEngine.WARNING("Body count has superceded the warning threshold! " + bodies.size());
|
||||
}
|
||||
// OdeHelper.createBody(world);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user