Bugfixes
This commit is contained in:
@@ -41,27 +41,31 @@ public class AsyncLogic{
|
||||
}
|
||||
|
||||
public void begin(){
|
||||
//sync begin
|
||||
for(AsyncProcess p : processes){
|
||||
p.begin();
|
||||
}
|
||||
if(Vars.state.isPlaying()){
|
||||
//sync begin
|
||||
for(AsyncProcess p : processes){
|
||||
p.begin();
|
||||
}
|
||||
|
||||
futures.clear();
|
||||
futures.clear();
|
||||
|
||||
//submit all tasks
|
||||
for(AsyncProcess p : processes){
|
||||
if(p.shouldProcess()){
|
||||
futures.add(executor.submit(p::process));
|
||||
//submit all tasks
|
||||
for(AsyncProcess p : processes){
|
||||
if(p.shouldProcess()){
|
||||
futures.add(executor.submit(p::process));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void end(){
|
||||
complete();
|
||||
if(Vars.state.isPlaying()){
|
||||
complete();
|
||||
|
||||
//sync end (flush data)
|
||||
for(AsyncProcess p : processes){
|
||||
p.end();
|
||||
//sync end (flush data)
|
||||
for(AsyncProcess p : processes){
|
||||
p.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public class PhysicsProcess implements AsyncProcess{
|
||||
ref.lastVelocity.set(ref.velocity);
|
||||
}
|
||||
|
||||
physics.step(Core.graphics.getDeltaTime(), 8, 8);
|
||||
physics.step(Core.graphics.getDeltaTime(), 5, 8);
|
||||
|
||||
//get delta vectors
|
||||
for(PhysicRef ref : refs){
|
||||
@@ -121,7 +121,7 @@ public class PhysicsProcess implements AsyncProcess{
|
||||
ref.position.set(entity);
|
||||
|
||||
//add delta velocity - this doesn't work very well yet
|
||||
//entity.vel().add(ref.velocity).sub(ref.lastVelocity);
|
||||
entity.vel().add(ref.velocity).sub(ref.lastVelocity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user