[DEV] update some logs models
This commit is contained in:
parent
7628561fb6
commit
3068e57245
@ -27,7 +27,7 @@ public class EgeScene extends Widget {
|
|||||||
* @param _event Time generic event
|
* @param _event Time generic event
|
||||||
*/
|
*/
|
||||||
protected static void periodicCall(final EgeScene self, final EventTime event) {
|
protected static void periodicCall(final EgeScene self, final EventTime event) {
|
||||||
Log.verbose("Periodic call on Entry(" + event + ")");
|
Log.verbose("Periodic call on Entry({});", event);
|
||||||
/*
|
/*
|
||||||
if (!self.shape.periodicCall(event)) {
|
if (!self.shape.periodicCall(event)) {
|
||||||
//Log.error("end periodic call");
|
//Log.error("end periodic call");
|
||||||
@ -83,7 +83,7 @@ public class EgeScene extends Widget {
|
|||||||
this.minSize = Vector3f.VALUE_128;
|
this.minSize = Vector3f.VALUE_128;
|
||||||
// verify the min max of the min size ...
|
// verify the min max of the min size ...
|
||||||
checkMinSize();
|
checkMinSize();
|
||||||
Log.error("min size = " + this.minSize);
|
Log.error("min size = {}", this.minSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected float getAspectRatio() {
|
protected float getAspectRatio() {
|
||||||
@ -137,7 +137,7 @@ public class EgeScene extends Widget {
|
|||||||
public boolean onEventInput(final EventInput event) {
|
public boolean onEventInput(final EventInput event) {
|
||||||
keepFocus();
|
keepFocus();
|
||||||
Vector3f relPos = relativePosition(new Vector3f(event.pos().x(), event.pos().y(), 0));
|
Vector3f relPos = relativePosition(new Vector3f(event.pos().x(), event.pos().y(), 0));
|
||||||
//Log.warning("Event on Input ... " + event + " relPos = " + relPos);
|
//Log.warning("Event on Input ... {} relPos= {}", event, relPos);
|
||||||
this.env.onPointer(event.specialKey(), event.type(), event.inputId(), relPos, event.status());
|
this.env.onPointer(event.specialKey(), event.type(), event.inputId(), relPos, event.status());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -86,23 +86,23 @@ public class ToolMapHeight implements MapToolInterface {
|
|||||||
// max brush
|
// max brush
|
||||||
if (event.inputId() == 4 && event.status() == KeyStatus.down && (event.specialKey() != null && event.specialKey().getAltLeft() && event.specialKey().getCtrlLeft())) {
|
if (event.inputId() == 4 && event.status() == KeyStatus.down && (event.specialKey() != null && event.specialKey().getAltLeft() && event.specialKey().getCtrlLeft())) {
|
||||||
this.maxBrush = Maths.avg(this.minBrush + 0.1f, this.maxBrush + 0.1f, 128.0f);
|
this.maxBrush = Maths.avg(this.minBrush + 0.1f, this.maxBrush + 0.1f, 128.0f);
|
||||||
Log.warning(" values: " + this.minBrush + " / " + this.maxBrush);
|
Log.warning(" values: {} / {}", this.minBrush, this.maxBrush);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (event.inputId() == 5 && event.status() == KeyStatus.down && (event.specialKey() != null && event.specialKey().getAltLeft() && event.specialKey().getCtrlLeft())) {
|
if (event.inputId() == 5 && event.status() == KeyStatus.down && (event.specialKey() != null && event.specialKey().getAltLeft() && event.specialKey().getCtrlLeft())) {
|
||||||
this.maxBrush = Maths.avg(this.minBrush + 0.1f, this.maxBrush - 0.1f, 128.0f);
|
this.maxBrush = Maths.avg(this.minBrush + 0.1f, this.maxBrush - 0.1f, 128.0f);
|
||||||
Log.warning(" values: " + this.minBrush + " / " + this.maxBrush);
|
Log.warning(" values: {} / {}", this.minBrush, this.maxBrush);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// min brush
|
// min brush
|
||||||
if (event.inputId() == 4 && event.status() == KeyStatus.down && (event.specialKey() != null && event.specialKey().getAltLeft())) {
|
if (event.inputId() == 4 && event.status() == KeyStatus.down && (event.specialKey() != null && event.specialKey().getAltLeft())) {
|
||||||
this.minBrush = Maths.avg(-128.0f, this.minBrush + 0.1f, this.maxBrush - 0.1f);
|
this.minBrush = Maths.avg(-128.0f, this.minBrush + 0.1f, this.maxBrush - 0.1f);
|
||||||
Log.warning(" values: " + this.minBrush + " / " + this.maxBrush);
|
Log.warning(" values: {} / {}", this.minBrush, this.maxBrush);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (event.inputId() == 5 && event.status() == KeyStatus.down && (event.specialKey() != null && event.specialKey().getAltLeft())) {
|
if (event.inputId() == 5 && event.status() == KeyStatus.down && (event.specialKey() != null && event.specialKey().getAltLeft())) {
|
||||||
this.minBrush = Maths.avg(-128.0f, this.minBrush - 0.1f, this.maxBrush - 0.1f);
|
this.minBrush = Maths.avg(-128.0f, this.minBrush - 0.1f, this.maxBrush - 0.1f);
|
||||||
Log.warning(" values: " + this.minBrush + " / " + this.maxBrush);
|
Log.warning(" values: {} / {}", this.minBrush, this.maxBrush);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// width brush
|
// width brush
|
||||||
|
@ -79,7 +79,7 @@ public class ControlCameraPlayer implements ControlInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onEventInput(final EventInput event, final Vector3f relativePosition) {
|
public boolean onEventInput(final EventInput event, final Vector3f relativePosition) {
|
||||||
// Log.info("" + event);
|
// Log.info("{}", event);
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
if (!this.fpsMode) {
|
if (!this.fpsMode) {
|
||||||
if (event.inputId() == 4) {
|
if (event.inputId() == 4) {
|
||||||
@ -120,7 +120,7 @@ public class ControlCameraPlayer implements ControlInterface {
|
|||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
this.camera.setRoll(this.camera.getRoll() - (float)Math.toRadians(delta.x * this.player.getTurnSpeed()));
|
this.camera.setRoll(this.camera.getRoll() - (float)Math.toRadians(delta.x * this.player.getTurnSpeed()));
|
||||||
Log.info("Change camera: " + this.camera.getYaw() + " " + this.camera.getPitch());
|
Log.info("Change camera: {} {}", this.camera.getYaw(), this.camera.getPitch());
|
||||||
if (this.camera.getRoll()>Math.PI) {
|
if (this.camera.getRoll()>Math.PI) {
|
||||||
this.camera.setRoll(this.camera.getRoll()-(float)Math.PI*2.0f);
|
this.camera.setRoll(this.camera.getRoll()-(float)Math.PI*2.0f);
|
||||||
}
|
}
|
||||||
@ -141,7 +141,7 @@ public class ControlCameraPlayer implements ControlInterface {
|
|||||||
}
|
}
|
||||||
this.playerPosition.setAngles(new Vector3f(0, 0, tmpAngle));
|
this.playerPosition.setAngles(new Vector3f(0, 0, tmpAngle));
|
||||||
this.camera.setRoll(-playerZAngle);
|
this.camera.setRoll(-playerZAngle);
|
||||||
Log.info("Change camera: " + this.camera.getYaw() + " " + this.camera.getPitch());
|
Log.info("Change camera: {} {}", this.camera.getYaw(), this.camera.getPitch());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -182,7 +182,7 @@ public class ControlCameraPlayer implements ControlInterface {
|
|||||||
distance = speed * walkFactor * event.getTimeDeltaCallSecond();
|
distance = speed * walkFactor * event.getTimeDeltaCallSecond();
|
||||||
final float dxStraf = (float) (distance * Math.sin((float) Math.PI * 0.5f + playerZAngle));
|
final float dxStraf = (float) (distance * Math.sin((float) Math.PI * 0.5f + playerZAngle));
|
||||||
final float dyStraf = -(float) (distance * Math.cos((float) Math.PI * 0.5f + playerZAngle));
|
final float dyStraf = -(float) (distance * Math.cos((float) Math.PI * 0.5f + playerZAngle));
|
||||||
//Log.error("update position ..." + dx + " " + dy);
|
//Log.error("update position ... {} {}", dx, dy);
|
||||||
Vector3f tmpPos = playerTransform.getPosition();
|
Vector3f tmpPos = playerTransform.getPosition();
|
||||||
tmpPos = tmpPos.add(new Vector3f(dx + dxStraf, dy + dyStraf, 0));
|
tmpPos = tmpPos.add(new Vector3f(dx + dxStraf, dy + dyStraf, 0));
|
||||||
playerTransform = playerTransform.withPosition(tmpPos);
|
playerTransform = playerTransform.withPosition(tmpPos);
|
||||||
@ -190,15 +190,15 @@ public class ControlCameraPlayer implements ControlInterface {
|
|||||||
this.playerPosition.setTransform(playerTransform);
|
this.playerPosition.setTransform(playerTransform);
|
||||||
}
|
}
|
||||||
// here the camera is behind the player, we need to move the camera ...
|
// here the camera is behind the player, we need to move the camera ...
|
||||||
//Log.info(" pitch: " + Math.toDegrees(this.camera.getPitch()) + " " + Math.toDegrees(playerZAngle));
|
//Log.info(" pitch: {} {}", Math.toDegrees(this.camera.getPitch()), Math.toDegrees(playerZAngle));
|
||||||
final float horinzontalDistance = (float) (this.distanceFromCenter * Math.sin(this.camera.getPitch()));
|
final float horinzontalDistance = (float) (this.distanceFromCenter * Math.sin(this.camera.getPitch()));
|
||||||
final float verticalDistance = (float) (this.distanceFromCenter * Math.cos(this.camera.getPitch()));
|
final float verticalDistance = (float) (this.distanceFromCenter * Math.cos(this.camera.getPitch()));
|
||||||
//Log.info(" distanceFromCenter " + distanceFromCenter);
|
//Log.info(" distanceFromCenter {}", distanceFromCenter);
|
||||||
final float tmp = -horinzontalDistance;
|
final float tmp = -horinzontalDistance;
|
||||||
final float theta = (float) Math.PI + playerZAngle;// - (float)Math.PI*0.5f;
|
final float theta = (float) Math.PI + playerZAngle;// - (float)Math.PI*0.5f;
|
||||||
final float offsetX = (float) (tmp * Math.sin(-theta));
|
final float offsetX = (float) (tmp * Math.sin(-theta));
|
||||||
final float offsetY = (float) (tmp * Math.cos(-theta));
|
final float offsetY = (float) (tmp * Math.cos(-theta));
|
||||||
//Log.info(" res" + offsetX + " " + offsetY);
|
//Log.info(" res=({},{})", offsetX, offsetY);
|
||||||
this.camera.setPosition(new Vector3f(playerTransform.getPosition().x() + offsetX, playerTransform.getPosition().y() + offsetY, playerTransform.getPosition().z() + 1.6f + verticalDistance));
|
this.camera.setPosition(new Vector3f(playerTransform.getPosition().x() + offsetX, playerTransform.getPosition().y() + offsetY, playerTransform.getPosition().z() + 1.6f + verticalDistance));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class ControlCameraPlayerFPS implements ControlInterface {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onEventInput(final EventInput event, final Vector3f relativePosition) {
|
public boolean onEventInput(final EventInput event, final Vector3f relativePosition) {
|
||||||
// Log.info("" + event);
|
// Log.info("{}", event);
|
||||||
// in grabbing mouse only:
|
// in grabbing mouse only:
|
||||||
if (!Gale.getContext().isGrabPointerEvents()) {
|
if (!Gale.getContext().isGrabPointerEvents()) {
|
||||||
return false;
|
return false;
|
||||||
@ -76,7 +76,7 @@ public class ControlCameraPlayerFPS implements ControlInterface {
|
|||||||
this.camera.setPitch((float) -Math.PI);
|
this.camera.setPitch((float) -Math.PI);
|
||||||
}
|
}
|
||||||
this.camera.setRoll(this.camera.getRoll() - (float) Math.toRadians(delta.x() * this.player.getTurnSpeed()));
|
this.camera.setRoll(this.camera.getRoll() - (float) Math.toRadians(delta.x() * this.player.getTurnSpeed()));
|
||||||
Log.info("Change camera: " + this.camera.getYaw() + " " + this.camera.getPitch());
|
Log.info("Change camera: {} {}", this.camera.getYaw(), this.camera.getPitch());
|
||||||
if (this.camera.getRoll() > Math.PI) {
|
if (this.camera.getRoll() > Math.PI) {
|
||||||
this.camera.setRoll(this.camera.getRoll() - (float) Math.PI * 2.0f);
|
this.camera.setRoll(this.camera.getRoll() - (float) Math.PI * 2.0f);
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ public class ControlCameraPlayerFPS implements ControlInterface {
|
|||||||
distance = speed * event.getTimeDeltaCallSecond();
|
distance = speed * event.getTimeDeltaCallSecond();
|
||||||
float dxStraf = (float) (distance * Math.sin((float) Math.PI * 0.5f + this.playerPosition.getAngles().z()));
|
float dxStraf = (float) (distance * Math.sin((float) Math.PI * 0.5f + this.playerPosition.getAngles().z()));
|
||||||
float dyStraf = (float) (distance * Math.cos((float) Math.PI * 0.5f + this.playerPosition.getAngles().z()));
|
float dyStraf = (float) (distance * Math.cos((float) Math.PI * 0.5f + this.playerPosition.getAngles().z()));
|
||||||
//Log.error("update position ..." + dx + " " + dy);
|
//Log.error("update position ... {} {}", dx, dy);
|
||||||
this.playerPosition.setTransform(this.playerPosition.getTransform().withPosition(this.playerPosition.getTransform().getPosition().add(dx + dxStraf, dy + dyStraf, 0)));
|
this.playerPosition.setTransform(this.playerPosition.getTransform().withPosition(this.playerPosition.getTransform().getPosition().add(dx + dxStraf, dy + dyStraf, 0)));
|
||||||
this.camera.setPosition(this.playerPosition.getTransform().getPosition());
|
this.camera.setPosition(this.playerPosition.getTransform().getPosition());
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ public class Entity {
|
|||||||
* @return true, the Entity is corectly initialized.
|
* @return true, the Entity is corectly initialized.
|
||||||
*/
|
*/
|
||||||
public boolean init() {
|
public boolean init() {
|
||||||
Log.warning("init() not implemented: uId=" + this.uID);
|
Log.warning("init() not implemented: uId={}", this.uID);
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ public class Entity {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
public boolean init(final Object description) {
|
public boolean init(final Object description) {
|
||||||
Log.warning("init(Object) not implemented: uId=" + this.uID);
|
Log.warning("init(Object) not implemented: uId={}", this.uID);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,7 +256,7 @@ public class Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (findIt == false) {
|
if (findIt == false) {
|
||||||
//Log.error("try to remove an unexisting component type : '" + type + "'");
|
//Log.error("try to remove an unknown component type : '{}'", type);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.env.engineComponentRemove(componentRemoved);
|
this.env.engineComponentRemove(componentRemoved);
|
||||||
@ -277,7 +277,7 @@ public class Entity {
|
|||||||
this.life += power;
|
this.life += power;
|
||||||
this.life = Math.min(Math.max(0.0f, this.life), this.lifeMax);
|
this.life = Math.min(Math.max(0.0f, this.life), this.lifeMax);
|
||||||
if (this.life <= 0) {
|
if (this.life <= 0) {
|
||||||
Log.debug("[" + getUID() + "] Entity is killed ...");
|
Log.debug("[{}] Entity is killed ...", getUID());
|
||||||
}
|
}
|
||||||
if (this.life != previousLife) {
|
if (this.life != previousLife) {
|
||||||
onLifeChange();
|
onLifeChange();
|
||||||
|
@ -42,9 +42,9 @@ public class Environement {
|
|||||||
Log.error("Try to add an empty CREATOR ...");
|
Log.error("Try to add an empty CREATOR ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Log.debug("Add creator: " + type);
|
Log.debug("Add creator: {}", type);
|
||||||
creators.put(type, creator);
|
creators.put(type, creator);
|
||||||
Log.debug("Add creator: " + type + " (done)");
|
Log.debug("Add creator: {} (done)", type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,17 +144,17 @@ public class Environement {
|
|||||||
*/
|
*/
|
||||||
public Entity createEntity(final String type, final Object value, final boolean autoAddEntity) {
|
public Entity createEntity(final String type, final Object value, final boolean autoAddEntity) {
|
||||||
if (creators.containsKey(type) == false) {
|
if (creators.containsKey(type) == false) {
|
||||||
Log.error("Request creating of an type that is not known '" + type + "'");
|
Log.error("Request creating of an type that is not known '{}'", type);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final CreatorEntity creatorPointer = creators.get(type);
|
final CreatorEntity creatorPointer = creators.get(type);
|
||||||
if (creatorPointer == null) {
|
if (creatorPointer == null) {
|
||||||
Log.error("null pointer creator == > internal error... '" + type + "'");
|
Log.error("null pointer creator == > internal error... '{}'", type);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final Entity tmpEntity = creatorPointer.create(this, value);
|
final Entity tmpEntity = creatorPointer.create(this, value);
|
||||||
if (tmpEntity == null) {
|
if (tmpEntity == null) {
|
||||||
Log.error("allocation error '" + type + "'");
|
Log.error("allocation error ''{}'", type);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (autoAddEntity == true) {
|
if (autoAddEntity == true) {
|
||||||
@ -298,7 +298,7 @@ public class Environement {
|
|||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Log.error("try to get an unexisting engine type: '" + type + "'");
|
Log.error("try to get an unexisting engine type: ''{}'", type);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -355,23 +355,23 @@ public class Environement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void render(final long deltaMilli, final String cameraName) {
|
public void render(final long deltaMilli, final String cameraName) {
|
||||||
//Log.error("Render: " + cameraName + " time:" + deltaMilli);
|
//Log.error("Render: {} time: {}", cameraName, deltaMilli);
|
||||||
// get the correct camera:
|
// get the correct camera:
|
||||||
final Camera camera = getCamera(cameraName);
|
final Camera camera = getCamera(cameraName);
|
||||||
if (camera == null) {
|
if (camera == null) {
|
||||||
Log.error("Render: Can not get camera named: '" + cameraName + "'");
|
Log.error("Render: Can not get camera named: '{}'", cameraName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
OpenGL.setCameraMatrix(camera.getConvertionMatrix());
|
OpenGL.setCameraMatrix(camera.getConvertionMatrix());
|
||||||
for (final Engine it : this.engines) {
|
for (final Engine it : this.engines) {
|
||||||
//Log.verbose(" render: " + it.getType());
|
//Log.verbose(" render: {}", it.getType());
|
||||||
it.render(deltaMilli, camera);
|
it.render(deltaMilli, camera);
|
||||||
}
|
}
|
||||||
// for (Engine it: engine) {
|
// for (Engine it: engine) {
|
||||||
// if(it == null) {
|
// if(it == null) {
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
// Log.verbose(" render: " + it.getType());
|
// Log.verbose(" render: {}", it.getType());
|
||||||
// it.renderDebug(deltaMilli, camera);
|
// it.renderDebug(deltaMilli, camera);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ public class ComponentLight extends Component {
|
|||||||
if (component instanceof PositionningInterface tmp) {
|
if (component instanceof PositionningInterface tmp) {
|
||||||
this.position = tmp;
|
this.position = tmp;
|
||||||
} else {
|
} else {
|
||||||
Log.error("component: " + component.getClass().getCanonicalName() + " is not an instance of " + PositionningInterface.class.getCanonicalName());
|
Log.error("component: {} is not an instance of {}", component.getClass().getCanonicalName(), PositionningInterface.class.getCanonicalName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ public class ComponentPhysics extends Component {
|
|||||||
gravityAcceleration = new Vector3f(0, 0, 0);
|
gravityAcceleration = new Vector3f(0, 0, 0);
|
||||||
}
|
}
|
||||||
// apply this force on the Object
|
// apply this force on the Object
|
||||||
Log.info("apply gravity: " + gravityAcceleration);
|
Log.info("apply gravity: {}", gravityAcceleration);
|
||||||
// relative to the object
|
// relative to the object
|
||||||
Vector3f staticForce = this.staticForce;
|
Vector3f staticForce = this.staticForce;
|
||||||
float globalMass = 0;
|
float globalMass = 0;
|
||||||
@ -156,8 +156,8 @@ public class ComponentPhysics extends Component {
|
|||||||
this.acceleration = gravityAcceleration.add(globalForce);
|
this.acceleration = gravityAcceleration.add(globalForce);
|
||||||
this.speed = this.speed.add(this.acceleration.multiply(timeStep));
|
this.speed = this.speed.add(this.acceleration.multiply(timeStep));
|
||||||
limitWithMaxSpeed();
|
limitWithMaxSpeed();
|
||||||
Log.info("apply acceleration: " + this.acceleration);
|
Log.info("apply acceleration: {}", this.acceleration);
|
||||||
Log.info("apply speed: " + this.speed);
|
Log.info("apply speed: {}", this.speed);
|
||||||
this.position.setTransform(this.position.getTransform().withPosition(this.position.getTransform().getPosition().add(this.speed)));
|
this.position.setTransform(this.position.getTransform().withPosition(this.position.getTransform().getPosition().add(this.speed)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ public class ComponentPhysics extends Component {
|
|||||||
} else if (shape instanceof PhysicMapVoxel shape222) {
|
} else if (shape instanceof PhysicMapVoxel shape222) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Log.error("Not manage collision model... " + shape);
|
Log.error("Not manage collision model... {}", shape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (shapeCurrent instanceof PhysicSphere shape111) {
|
} else if (shapeCurrent instanceof PhysicSphere shape111) {
|
||||||
@ -254,7 +254,7 @@ public class ComponentPhysics extends Component {
|
|||||||
} else if (shape instanceof PhysicMapVoxel shape222) {
|
} else if (shape instanceof PhysicMapVoxel shape222) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Log.error("Not manage collision model... " + shape);
|
Log.error("Not manage collision model... {}", shape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (shapeCurrent instanceof PhysicMapVoxel shape111) {
|
} else if (shapeCurrent instanceof PhysicMapVoxel shape111) {
|
||||||
@ -266,11 +266,11 @@ public class ComponentPhysics extends Component {
|
|||||||
} else if (shape instanceof PhysicMapVoxel shape222) {
|
} else if (shape instanceof PhysicMapVoxel shape222) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Log.error("Not manage collision model... " + shape);
|
Log.error("Not manage collision model... {}", shape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Log.error("Not manage collision model... " + shapeCurrent);
|
Log.error("Not manage collision model... {}", shapeCurrent);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -355,7 +355,7 @@ public class ComponentPhysics extends Component {
|
|||||||
} else if (shapeRemote instanceof PhysicTriangle) {
|
} else if (shapeRemote instanceof PhysicTriangle) {
|
||||||
// nothing can happens ...
|
// nothing can happens ...
|
||||||
} else {
|
} else {
|
||||||
Log.error("Not manage collision model... " + shapeRemote);
|
Log.error("Not manage collision model... {}", shapeRemote);
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ public class ComponentStaticMeshs extends Component {
|
|||||||
|
|
||||||
public ComponentStaticMeshs(Uri meshUrl) {
|
public ComponentStaticMeshs(Uri meshUrl) {
|
||||||
// TODO load Mesh
|
// TODO load Mesh
|
||||||
Log.critical("Can not Load the Mesh for now ... " + meshUrl);
|
Log.critical("Can not Load the Mesh for now ... {}", meshUrl);
|
||||||
final ResourceStaticMeshObj mesh = ResourceStaticMeshObj.create(meshUrl);
|
final ResourceStaticMeshObj mesh = ResourceStaticMeshObj.create(meshUrl);
|
||||||
setMesh("default", mesh);
|
setMesh("default", mesh);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ public class LightRender implements PartRenderInterface {
|
|||||||
// injection stage
|
// injection stage
|
||||||
for (int iii = 0; iii < LightRender.numberOfLight; iii++) {
|
for (int iii = 0; iii < LightRender.numberOfLight; iii++) {
|
||||||
if (lights[iii] != null) {
|
if (lights[iii] != null) {
|
||||||
//Log.warning("Set light : [" + iii + "] " + lights[iii]);
|
//Log.warning("Set light : [{}] {}", iii, lights[iii]);
|
||||||
program.uniformVector(this.GLlights[iii].oGLposition, lights[iii].getPositionDelta());
|
program.uniformVector(this.GLlights[iii].oGLposition, lights[iii].getPositionDelta());
|
||||||
program.uniformColorRGB(this.GLlights[iii].oGLcolor, lights[iii].getColor());
|
program.uniformColorRGB(this.GLlights[iii].oGLcolor, lights[iii].getColor());
|
||||||
program.uniformVector(this.GLlights[iii].oGLattenuation, lights[iii].getAttenuation());
|
program.uniformVector(this.GLlights[iii].oGLattenuation, lights[iii].getAttenuation());
|
||||||
|
@ -56,8 +56,8 @@ public class EngineAI extends Engine {
|
|||||||
this.accumulator += deltaMili * 0.0001f;
|
this.accumulator += deltaMili * 0.0001f;
|
||||||
// While there is enough accumulated time to take one or several physics steps
|
// While there is enough accumulated time to take one or several physics steps
|
||||||
while (this.accumulator >= TIME_STEP) {
|
while (this.accumulator >= TIME_STEP) {
|
||||||
//Log.warning("AI: Generate for " + accumulator + " / " + TIME_STEP + " for:" + components.size());
|
//Log.warning("AI: Generate for {} / {} for: {}", accumulator, TIME_STEP, components.size());
|
||||||
// call every object to usdate their constant forces applyed
|
// call every object to update their constant forces applied
|
||||||
for (ComponentAI it : this.components) {
|
for (ComponentAI it : this.components) {
|
||||||
it.update(TIME_STEP);
|
it.update(TIME_STEP);
|
||||||
}
|
}
|
||||||
|
@ -34,13 +34,13 @@ public class EngineDynamicMeshs extends Engine {
|
|||||||
@Override
|
@Override
|
||||||
public void update(long deltaMili) {
|
public void update(long deltaMili) {
|
||||||
|
|
||||||
//Log.warning("engine update : " + deltaMili + " " + accumulator + " >= " + TIME_STEP);
|
//Log.warning("engine update : {} {} >= {}", deltaMili, accumulator, TIME_STEP);
|
||||||
// Add the time difference in the accumulator
|
// Add the time difference in the accumulator
|
||||||
accumulator += (float)deltaMili*0.0001f;
|
accumulator += (float)deltaMili*0.0001f;
|
||||||
// While there is enough accumulated time to take one or several physics steps
|
// While there is enough accumulated time to take one or several physics steps
|
||||||
while (accumulator >= TIME_STEP) {
|
while (accumulator >= TIME_STEP) {
|
||||||
//Log.warning("Generate for " + accumulator + " / " + TIME_STEP + " for:" + components.size());
|
//Log.warning("Generate for {} / {} for: {}", accumulator, TIME_STEP, components.size());
|
||||||
// call every object to usdate their constant forces applyed
|
// call every object to update their constant forces applied
|
||||||
for (ComponentDynamicMeshs it: components) {
|
for (ComponentDynamicMeshs it: components) {
|
||||||
it.update(TIME_STEP);
|
it.update(TIME_STEP);
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ public class EngineLight extends Engine {
|
|||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
//Log.warning("Get " + count + "/" + out.length + " lights (SUN) ...");
|
//Log.warning("Get {}/{} lights (SUN) ...", count, out.length);
|
||||||
float maxDistance = 50*50;
|
float maxDistance = 50*50;
|
||||||
for (ComponentLight elem: this.componentLights) {
|
for (ComponentLight elem: this.componentLights) {
|
||||||
Vector3f pos = elem.getPosition();
|
Vector3f pos = elem.getPosition();
|
||||||
@ -83,7 +83,7 @@ public class EngineLight extends Engine {
|
|||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Log.warning("Get " + count + "/" + out.length + " lights...");
|
//Log.warning("Get {} / {} lights...", count, out.length,);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ public class EngineMap extends Engine {
|
|||||||
accumulator += (float)deltaMili*0.0001f;
|
accumulator += (float)deltaMili*0.0001f;
|
||||||
// While there is enough accumulated time to take one or several physics steps
|
// While there is enough accumulated time to take one or several physics steps
|
||||||
while (accumulator >= TIME_STEP) {
|
while (accumulator >= TIME_STEP) {
|
||||||
// Log.warning("MAP: Generate for " + accumulator + " / " + TIME_STEP + " for:" + components.size());
|
// Log.warning("MAP: Generate for {} / {} for: {}", accumulator, TIME_STEP, components.size());
|
||||||
// call every object to update their constant forces applied
|
// call every object to update their constant forces applied
|
||||||
for (ComponentMap it: components) {
|
for (ComponentMap it: components) {
|
||||||
it.update(TIME_STEP);
|
it.update(TIME_STEP);
|
||||||
|
@ -86,7 +86,7 @@ public class EnginePhysics extends Engine {
|
|||||||
public void render(long deltaMili, Camera camera) {
|
public void render(long deltaMili, Camera camera) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
for (ComponentPhysics it : this.components) {
|
for (ComponentPhysics it : this.components) {
|
||||||
//Log.info("Render " + it);
|
//Log.info("Render {}", it);
|
||||||
it.renderDebug(this.debugDrawProperty);
|
it.renderDebug(this.debugDrawProperty);
|
||||||
}
|
}
|
||||||
//debugDrawProperty.drawCone(2, 5, 9, 12, Matrix4f.identity(), new Color(1,1,0,1));
|
//debugDrawProperty.drawCone(2, 5, 9, 12, Matrix4f.identity(), new Color(1,1,0,1));
|
||||||
@ -107,7 +107,7 @@ public class EnginePhysics extends Engine {
|
|||||||
this.accumulator += deltaMili * 0.0001f;
|
this.accumulator += deltaMili * 0.0001f;
|
||||||
// While there is enough accumulated time to take one or several physics steps
|
// While there is enough accumulated time to take one or several physics steps
|
||||||
while (this.accumulator >= TIME_STEP) {
|
while (this.accumulator >= TIME_STEP) {
|
||||||
Log.verbose("update physic ... " + this.accumulator);
|
Log.verbose("update physic ... {}", this.accumulator);
|
||||||
clearPreviousCycle();
|
clearPreviousCycle();
|
||||||
applyForces(TIME_STEP);
|
applyForces(TIME_STEP);
|
||||||
// update AABB after because in rotation force, the Bounding box change...
|
// update AABB after because in rotation force, the Bounding box change...
|
||||||
|
@ -45,12 +45,12 @@ public class EngineRender extends Engine {
|
|||||||
//Log.info("Render ...");
|
//Log.info("Render ...");
|
||||||
//Matrix4f tmpMatrix;
|
//Matrix4f tmpMatrix;
|
||||||
for (final ComponentRender it : this.components) {
|
for (final ComponentRender it : this.components) {
|
||||||
//Log.info("Render " + it);
|
//Log.info("Render {}", it);
|
||||||
it.render();
|
it.render();
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
getOrderedElementForDisplay(this.displayElementOrdered, camera->getEye(), camera->getViewVector());
|
getOrderedElementForDisplay(this.displayElementOrdered, camera->getEye(), camera->getViewVector());
|
||||||
Log.verbose("DRAW : " + this.displayElementOrdered.size() + "/" + this.component.size() + " elements");
|
Log.verbose("DRAW : {} / {} element(s)", this.displayElementOrdered.size(), this.component.size());
|
||||||
|
|
||||||
// note : the first pass is done at the reverse way to prevent multiple display od the same point in the screen
|
// note : the first pass is done at the reverse way to prevent multiple display od the same point in the screen
|
||||||
// (and we remember that the first pass is to display all the non transparent elements)
|
// (and we remember that the first pass is to display all the non transparent elements)
|
||||||
@ -72,7 +72,7 @@ public class EngineRender extends Engine {
|
|||||||
// //Log.debug("Draw (start)");
|
// //Log.debug("Draw (start)");
|
||||||
// Matrix4f tmpMatrix;
|
// Matrix4f tmpMatrix;
|
||||||
// getOrderedElementForDisplay(this.displayElementOrdered, camera->getEye(), camera->getViewVector());
|
// getOrderedElementForDisplay(this.displayElementOrdered, camera->getEye(), camera->getViewVector());
|
||||||
// Log.verbose("DRAW : " + this.displayElementOrdered.size() + "/" + this.component.size() + " elements");
|
// Log.verbose("DRAW : {} / {} element(s)", this.displayElementOrdered.size(), this.component.size());
|
||||||
//// if (propertyDebugPhysic.get() == true) {
|
//// if (propertyDebugPhysic.get() == true) {
|
||||||
//// // Draw debug ... (Object)
|
//// // Draw debug ... (Object)
|
||||||
//// for (int32t iii=this.displayElementOrdered.size()-1; iii >= 0; iii--) {
|
//// for (int32t iii=this.displayElementOrdered.size()-1; iii >= 0; iii--) {
|
||||||
@ -118,7 +118,7 @@ public class EngineRender extends Engine {
|
|||||||
this.accumulator += deltaMili * 0.0001f;
|
this.accumulator += deltaMili * 0.0001f;
|
||||||
// While there is enough accumulated time to take one or several physics steps
|
// While there is enough accumulated time to take one or several physics steps
|
||||||
while (this.accumulator >= TIME_STEP) {
|
while (this.accumulator >= TIME_STEP) {
|
||||||
// Log.warning("RENDER: Generate for " + accumulator + " / " + TIME_STEP + " for:" + components.size());
|
// Log.warning("RENDER: Generate for {} / {} for: {}", accumulator, TIME_STEP, components.size());
|
||||||
// call every object to usdate their constant forces applyed
|
// call every object to usdate their constant forces applyed
|
||||||
for (final ComponentRender it : this.components) {
|
for (final ComponentRender it : this.components) {
|
||||||
it.update(TIME_STEP);
|
it.update(TIME_STEP);
|
||||||
@ -154,7 +154,7 @@ public class EngineRender extends Engine {
|
|||||||
// vec3 angleView = (destPosition - position);
|
// vec3 angleView = (destPosition - position);
|
||||||
// angleView.safeNormalize();
|
// angleView.safeNormalize();
|
||||||
// float dotResult = angleView.dot(direction);
|
// float dotResult = angleView.dot(direction);
|
||||||
// //Log.debug("Dot position : " + destPosition + " == > dot=" + dotResult);
|
// //Log.debug("Dot position : {} ==> dot={}", destPosition, dotResult);
|
||||||
// /*
|
// /*
|
||||||
// if (dotResult <= 0.85f) {
|
// if (dotResult <= 0.85f) {
|
||||||
// // they are not in the camera angle view ... == > no need to process display
|
// // they are not in the camera angle view ... == > no need to process display
|
||||||
|
@ -25,7 +25,7 @@ public class ComponentDynamicMeshsVoxelMap extends ComponentDynamicMeshs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawPlane(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
private void drawPlane(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
||||||
//Log.warning("Add plane Z : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz));
|
//Log.warning("Add plane Z : {}, {}, {}", (base.x + xxx), (base.y + yyy), (base.z + zzz));
|
||||||
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
||||||
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz);
|
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz);
|
||||||
Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy + 1, base.z() + zzz);
|
Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy + 1, base.z() + zzz);
|
||||||
@ -47,7 +47,7 @@ public class ComponentDynamicMeshsVoxelMap extends ComponentDynamicMeshs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawPlane_anti(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
private void drawPlane_anti(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
||||||
//Log.warning("Add plane Z : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz));
|
//Log.warning("Add plane Z : {}, {}, {}", (base.x + xxx), (base.y + yyy), (base.z + zzz));
|
||||||
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
||||||
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz);
|
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz);
|
||||||
Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy + 1, base.z() + zzz);
|
Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy + 1, base.z() + zzz);
|
||||||
@ -69,7 +69,7 @@ public class ComponentDynamicMeshsVoxelMap extends ComponentDynamicMeshs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawPlaneVerticalX(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
private void drawPlaneVerticalX(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
||||||
//Log.warning("Add plane X : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz));
|
//Log.warning("Add plane X : {}, {}, {}", (base.x + xxx), (base.y + yyy), (base.z + zzz));
|
||||||
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
||||||
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1);
|
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1);
|
||||||
Vector3f v3 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz + 1);
|
Vector3f v3 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz + 1);
|
||||||
@ -91,7 +91,7 @@ public class ComponentDynamicMeshsVoxelMap extends ComponentDynamicMeshs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawPlaneVerticalX_anti(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
private void drawPlaneVerticalX_anti(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
||||||
//Log.warning("Add plane X : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz));
|
//Log.warning("Add plane X : {}, {}, {}", (base.x + xxx), (base.y + yyy), (base.z + zzz));
|
||||||
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
||||||
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1);
|
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1);
|
||||||
Vector3f v3 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz + 1);
|
Vector3f v3 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz + 1);
|
||||||
@ -113,7 +113,7 @@ public class ComponentDynamicMeshsVoxelMap extends ComponentDynamicMeshs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawPlaneVerticalY(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
private void drawPlaneVerticalY(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
||||||
//Log.warning("Add plane Y : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz));
|
//Log.warning("Add plane Y : {}, {}, {}", (base.x + xxx), (base.y + yyy), (base.z + zzz));
|
||||||
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
||||||
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1);
|
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1);
|
||||||
Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy, base.z() + zzz + 1);
|
Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy, base.z() + zzz + 1);
|
||||||
@ -135,7 +135,7 @@ public class ComponentDynamicMeshsVoxelMap extends ComponentDynamicMeshs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawPlaneVerticalY_anti(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
private void drawPlaneVerticalY_anti(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) {
|
||||||
//Log.warning("Add plane Y : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz));
|
//Log.warning("Add plane Y : {}, {}, {}", (base.x + xxx), (base.y + yyy), (base.z + zzz));
|
||||||
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz);
|
||||||
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1);
|
Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1);
|
||||||
Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy, base.z() + zzz + 1);
|
Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy, base.z() + zzz + 1);
|
||||||
@ -158,13 +158,13 @@ public class ComponentDynamicMeshsVoxelMap extends ComponentDynamicMeshs {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(final String name) {
|
public void render(final String name) {
|
||||||
//Log.warning("Render : " + name);
|
//Log.warning("Render : {}", name);
|
||||||
super.render(name);
|
super.render(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(final float timeStep) {
|
public void update(final float timeStep) {
|
||||||
Log.warning("update : " + timeStep);
|
Log.warning("update : {}", timeStep);
|
||||||
if (this.chunk.haveChange() == false) {
|
if (this.chunk.haveChange() == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ public class ToolCollisionOBBWithOBB {
|
|||||||
// DebugDisplay.relativeTestPos.getTransform().setPosition(tmp);
|
// DebugDisplay.relativeTestPos.getTransform().setPosition(tmp);
|
||||||
// DebugDisplay.relativeTestPos.getTransform().setOrientation(quatTransfer);
|
// DebugDisplay.relativeTestPos.getTransform().setOrientation(quatTransfer);
|
||||||
// DebugDisplay.boxTest.setSize(box1.getSize());
|
// DebugDisplay.boxTest.setSize(box1.getSize());
|
||||||
// Log.info("" + rPos + quatTransfer1);
|
// Log.info("==> {} {}", rPos, quatTransfer1);
|
||||||
// /*res = */getCollidePointsAABBCenteredWithOBB(box1.narrowPhaseHalfSize, box2.narrowPhaseHalfSize, quatTransfer, rPos);
|
// /*res = */getCollidePointsAABBCenteredWithOBB(box1.narrowPhaseHalfSize, box2.narrowPhaseHalfSize, quatTransfer, rPos);
|
||||||
/* res = transfert in generic plan the new res ... */
|
/* res = transfert in generic plan the new res ... */
|
||||||
// test origin AABB with OBB collision
|
// test origin AABB with OBB collision
|
||||||
|
@ -24,7 +24,7 @@ public class Concave extends Shape {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
if (index.size() % 3 != 0) {
|
if (index.size() % 3 != 0) {
|
||||||
Log.error("wrong number of faces : " + index.size() + " ==> not a multiple of 3");
|
Log.error("wrong number of faces : {} ==> not a multiple of 3", index.size());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (final Integer it : index) {
|
for (final Integer it : index) {
|
||||||
|
@ -457,7 +457,7 @@ public class DynamicAABBTree<INTERNAL_DATA_TYPE> {
|
|||||||
final Stack<DTree> stack = new Stack<>();
|
final Stack<DTree> stack = new Stack<>();
|
||||||
// 64 max
|
// 64 max
|
||||||
stack.push(this.rootNode);
|
stack.push(this.rootNode);
|
||||||
//Log.error(" add stack: " + this.rootNode);
|
//Log.error(" add stack: {}", this.rootNode);
|
||||||
// While there are still nodes to visit
|
// While there are still nodes to visit
|
||||||
while (stack.size() > 0) {
|
while (stack.size() > 0) {
|
||||||
// Get the next node ID to visit
|
// Get the next node ID to visit
|
||||||
@ -468,7 +468,7 @@ public class DynamicAABBTree<INTERNAL_DATA_TYPE> {
|
|||||||
}
|
}
|
||||||
// Get the corresponding node
|
// Get the corresponding node
|
||||||
final DTree nodeToVisit = nodeIDToVisit;
|
final DTree nodeToVisit = nodeIDToVisit;
|
||||||
//Log.error(" check colision: " + nodeIDToVisit);
|
//Log.error(" check collision: {}", nodeIDToVisit);
|
||||||
// If the AABB in parameter overlaps with the AABB of the node to visit
|
// If the AABB in parameter overlaps with the AABB of the node to visit
|
||||||
if (aabb.intersect(nodeToVisit.aabb)) {
|
if (aabb.intersect(nodeToVisit.aabb)) {
|
||||||
// If the node is a leaf
|
// If the node is a leaf
|
||||||
@ -486,8 +486,8 @@ public class DynamicAABBTree<INTERNAL_DATA_TYPE> {
|
|||||||
// We need to visit its children
|
// We need to visit its children
|
||||||
stack.push(tmp.childrenleft);
|
stack.push(tmp.childrenleft);
|
||||||
stack.push(tmp.childrenright);
|
stack.push(tmp.childrenright);
|
||||||
//Log.error(" add stack: " + tmp.childrenleft);
|
//Log.error(" add stack: {}", tmp.childrenleft);
|
||||||
//Log.error(" add stack: " + tmp.childrenright);
|
//Log.error(" add stack: {}", tmp.childrenright);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -513,8 +513,8 @@ public class DynamicAABBTree<INTERNAL_DATA_TYPE> {
|
|||||||
public boolean updateObject(final DTree node, final AABB newAABB, final Vector3f displacement, final boolean forceReinsert) {
|
public boolean updateObject(final DTree node, final AABB newAABB, final Vector3f displacement, final boolean forceReinsert) {
|
||||||
assert (node.isLeaf());
|
assert (node.isLeaf());
|
||||||
assert (node.height >= 0);
|
assert (node.height >= 0);
|
||||||
//Log.verbose(" compare : " + node.aabb.getMin() + " " + node.aabb.getMax());
|
//Log.verbose(" compare : {} {}", node.aabb.getMin(), node.aabb.getMax());
|
||||||
//Log.verbose(" : " + newAABB.getMin() + " " + newAABB.getMax());
|
//Log.verbose(" : {} {}", newAABB.getMin(), newAABB.getMax());
|
||||||
// If the new AABB is still inside the fat AABB of the node
|
// If the new AABB is still inside the fat AABB of the node
|
||||||
if (!forceReinsert && node.aabb.contains(newAABB)) {
|
if (!forceReinsert && node.aabb.contains(newAABB)) {
|
||||||
return false;
|
return false;
|
||||||
@ -546,8 +546,8 @@ public class DynamicAABBTree<INTERNAL_DATA_TYPE> {
|
|||||||
zmax = node.aabb.getMax().z() + displacement.z();
|
zmax = node.aabb.getMax().z() + displacement.z();
|
||||||
}
|
}
|
||||||
node.aabb.set(xmin, ymin, zmin, xmax, ymax, zmax);
|
node.aabb.set(xmin, ymin, zmin, xmax, ymax, zmax);
|
||||||
//Log.error(" compare : " + node.aabb.getMin() + " " + node.aabb.getMax());
|
//Log.error(" compare : {} {}", node.aabb.getMin(), node.aabb.getMax());
|
||||||
//Log.error(" : " + newAABB.getMin() + " " + newAABB.getMax());
|
//Log.error(" : {} {}", newAABB.getMin(), newAABB.getMax());
|
||||||
if (!node.aabb.contains(newAABB)) {
|
if (!node.aabb.contains(newAABB)) {
|
||||||
//Log.critical("ERROR");
|
//Log.critical("ERROR");
|
||||||
}
|
}
|
||||||
|
@ -78,14 +78,14 @@ public class TestBasicLog {
|
|||||||
for (int iii = 0; iii < 100000000; iii++)
|
for (int iii = 0; iii < 100000000; iii++)
|
||||||
Log2.debug("test direct");
|
Log2.debug("test direct");
|
||||||
long timeStop = System.currentTimeMillis();
|
long timeStop = System.currentTimeMillis();
|
||||||
Log.print("test direct [END] : " + timeStart + " to " + timeStop + " ==> delta=" + (timeStop - timeStart));
|
Log.print("test direct [END]: {} to {} ==> delta={}", timeStart, timeStop, (timeStop - timeStart));
|
||||||
Log.print("test concat [START]");
|
Log.print("test concat [START]");
|
||||||
// C'est très long dans les 2 cas ...
|
// C'est très long dans les 2 cas ...
|
||||||
timeStart = System.currentTimeMillis();
|
timeStart = System.currentTimeMillis();
|
||||||
for (int iii = 0; iii < 6; iii++)
|
for (int iii = 0; iii < 6; iii++)
|
||||||
Log2.debug("test concat: non fonctionnel, il applelle le get a chaque log ... " + getAAAAAAA(iii));
|
Log2.debug("test concat: non fonctionnel, il applelle le get a chaque log ... " + getAAAAAAA(iii));
|
||||||
timeStop = System.currentTimeMillis();
|
timeStop = System.currentTimeMillis();
|
||||||
Log.print("test concat [END] : " + timeStart + " to " + timeStop + " ==> delta=" + (timeStop - timeStart));
|
Log.print("test concat [END]: {} to {} ==> delta={}\", timeStart, timeStop, (timeStop - timeStart));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user