sprinting/physics work
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
557b6da7de
commit
5c5ba32df7
@ -174,7 +174,7 @@
|
|||||||
"priorityCategory" : "CORE_MOVEMENT"
|
"priorityCategory" : "CORE_MOVEMENT"
|
||||||
},
|
},
|
||||||
"sprintSystem" : {
|
"sprintSystem" : {
|
||||||
"modifier" : 1.4,
|
"modifier" : 2.0,
|
||||||
"staminaMax" : 500,
|
"staminaMax" : 500,
|
||||||
"animationStartUp" : {
|
"animationStartUp" : {
|
||||||
"nameThirdPerson" : "Sprint",
|
"nameThirdPerson" : "Sprint",
|
||||||
|
|||||||
@ -2069,6 +2069,7 @@ Fix sprint animation data
|
|||||||
Color uniform on meshes
|
Color uniform on meshes
|
||||||
Fall and gravity tree fixes
|
Fall and gravity tree fixes
|
||||||
Potential window fix
|
Potential window fix
|
||||||
|
Sprinting/physics work
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ public class ClientSimulation {
|
|||||||
//
|
//
|
||||||
//simulate bullet physics engine step
|
//simulate bullet physics engine step
|
||||||
if(EngineState.EngineFlags.RUN_PHYSICS){
|
if(EngineState.EngineFlags.RUN_PHYSICS){
|
||||||
Globals.clientState.clientSceneWrapper.getCollisionEngine().simulatePhysics((float)Globals.engineState.timekeeper.getSimFrameTime());
|
Globals.clientState.clientSceneWrapper.getCollisionEngine().simulatePhysics();
|
||||||
Globals.clientState.clientSceneWrapper.getCollisionEngine().updateDynamicObjectTransforms();
|
Globals.clientState.clientSceneWrapper.getCollisionEngine().updateDynamicObjectTransforms();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -313,9 +313,8 @@ public class CollisionEngine {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs the collision and simulation phases for this collision engine
|
* Performs the collision and simulation phases for this collision engine
|
||||||
* @param time The time to increment the physics simulation by
|
|
||||||
*/
|
*/
|
||||||
public void simulatePhysics(float time){
|
public void simulatePhysics(){
|
||||||
Globals.profiler.beginCpuSample("physics");
|
Globals.profiler.beginCpuSample("physics");
|
||||||
spaceLock.lock();
|
spaceLock.lock();
|
||||||
// remove all contact joints
|
// remove all contact joints
|
||||||
@ -1217,7 +1216,7 @@ public class CollisionEngine {
|
|||||||
protected DBody createDBody(DGeom ...geom){
|
protected DBody createDBody(DGeom ...geom){
|
||||||
spaceLock.lock();
|
spaceLock.lock();
|
||||||
DBody body = OdeHelper.createBody(world);
|
DBody body = OdeHelper.createBody(world);
|
||||||
body.setDamping(DEFAULT_LINEAR_DAMPING, DEFAULT_ANGULAR_DAMPING);
|
// body.setDamping(DEFAULT_LINEAR_DAMPING, DEFAULT_ANGULAR_DAMPING);
|
||||||
body.setMaxAngularSpeed(DEFAULT_MAX_ANGULAR_SPEED);
|
body.setMaxAngularSpeed(DEFAULT_MAX_ANGULAR_SPEED);
|
||||||
if(geom != null){
|
if(geom != null){
|
||||||
for(int i = 0; i < geom.length; i++){
|
for(int i = 0; i < geom.length; i++){
|
||||||
|
|||||||
@ -64,7 +64,7 @@ public class Main {
|
|||||||
/**
|
/**
|
||||||
* target amount of time per frame
|
* target amount of time per frame
|
||||||
*/
|
*/
|
||||||
public static float targetFrameRate = 144.0f;
|
public static float targetFrameRate = 60.0f;
|
||||||
/**
|
/**
|
||||||
* Target period per frame
|
* Target period per frame
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -264,7 +264,7 @@ public class ServerGroundMovementTree implements BehaviorTree {
|
|||||||
// System.out.println(movementVector + " " + velocity * Main.deltaTime);
|
// System.out.println(movementVector + " " + velocity * Main.deltaTime);
|
||||||
|
|
||||||
//state machine
|
//state machine
|
||||||
switch(state){
|
switch(this.state){
|
||||||
case STARTUP: {
|
case STARTUP: {
|
||||||
CreatureUtils.setFacingVector(parent, facingVector);
|
CreatureUtils.setFacingVector(parent, facingVector);
|
||||||
rotation.set(movementQuaternion);
|
rotation.set(movementQuaternion);
|
||||||
@ -431,6 +431,9 @@ public class ServerGroundMovementTree implements BehaviorTree {
|
|||||||
} break;
|
} break;
|
||||||
case IDLE: {
|
case IDLE: {
|
||||||
} break;
|
} break;
|
||||||
|
default: {
|
||||||
|
throw new Error("Unsupported state!? " + this.state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -243,7 +243,7 @@ public class Realm {
|
|||||||
//
|
//
|
||||||
//simulate bullet physics engine step
|
//simulate bullet physics engine step
|
||||||
if(EngineState.EngineFlags.RUN_PHYSICS){
|
if(EngineState.EngineFlags.RUN_PHYSICS){
|
||||||
collisionEngine.simulatePhysics((float)Globals.engineState.timekeeper.getSimFrameTime());
|
collisionEngine.simulatePhysics();
|
||||||
collisionEngine.updateDynamicObjectTransforms();
|
collisionEngine.updateDynamicObjectTransforms();
|
||||||
PhysicsEntityUtils.serverRepositionEntities(this,collisionEngine);
|
PhysicsEntityUtils.serverRepositionEntities(this,collisionEngine);
|
||||||
chemistryEngine.collide();
|
chemistryEngine.collide();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user