add angularly static collidables
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
1314ceac06
commit
893752098e
@ -376,7 +376,8 @@
|
|||||||
"rotW": 1,
|
"rotW": 1,
|
||||||
"offsetX" : 0,
|
"offsetX" : 0,
|
||||||
"offsetY" : 0.4,
|
"offsetY" : 0.4,
|
||||||
"offsetZ" : 0
|
"offsetZ" : 0,
|
||||||
|
"angularlyStatic" : true
|
||||||
},
|
},
|
||||||
"attackMoves" : [
|
"attackMoves" : [
|
||||||
{
|
{
|
||||||
|
|||||||
@ -19,7 +19,6 @@
|
|||||||
Ticketed randomizer node for BTs to more heavily weight attacking and waiting
|
Ticketed randomizer node for BTs to more heavily weight attacking and waiting
|
||||||
|
|
||||||
+ bug fixes
|
+ bug fixes
|
||||||
Fix physics freakout for vertically aligned entities
|
|
||||||
Fix entities running to edge of map causing audio engine to break
|
Fix entities running to edge of map causing audio engine to break
|
||||||
|
|
||||||
Fix broken rendering pipeline when creating new level
|
Fix broken rendering pipeline when creating new level
|
||||||
|
|||||||
@ -594,6 +594,7 @@ Fix unequipping item hard crashing engine
|
|||||||
Fix terrain editing hard crashing engine
|
Fix terrain editing hard crashing engine
|
||||||
Fix attack animation mayyybe caching on non-local clients ??
|
Fix attack animation mayyybe caching on non-local clients ??
|
||||||
Fix sword double-swing
|
Fix sword double-swing
|
||||||
|
Fix physics freakout for vertically aligned entities
|
||||||
|
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|||||||
@ -880,6 +880,21 @@ public class CollisionEngine {
|
|||||||
spaceLock.release();
|
spaceLock.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether the body is angularly static or not
|
||||||
|
* @param body The body
|
||||||
|
* @param angularlyStatic true if angularly static, false otherwise
|
||||||
|
*/
|
||||||
|
protected void setAngularlyStatic(DBody body, boolean angularlyStatic){
|
||||||
|
spaceLock.acquireUninterruptibly();
|
||||||
|
if(angularlyStatic){
|
||||||
|
body.setMaxAngularSpeed(0);
|
||||||
|
} else {
|
||||||
|
body.setMaxAngularSpeed(1000);
|
||||||
|
}
|
||||||
|
spaceLock.release();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the geometry from the body
|
* Removes the geometry from the body
|
||||||
* @param body the body
|
* @param body the body
|
||||||
|
|||||||
@ -56,6 +56,9 @@ public class PhysicsEntityUtils {
|
|||||||
physicsTemplate.getOffsetX(), physicsTemplate.getOffsetY(), physicsTemplate.getOffsetZ(), //translate
|
physicsTemplate.getOffsetX(), physicsTemplate.getOffsetY(), physicsTemplate.getOffsetZ(), //translate
|
||||||
physicsTemplate.getRotX(), physicsTemplate.getRotY(), physicsTemplate.getRotZ(), physicsTemplate.getRotW() //rotate
|
physicsTemplate.getRotX(), physicsTemplate.getRotY(), physicsTemplate.getRotZ(), physicsTemplate.getRotW() //rotate
|
||||||
);
|
);
|
||||||
|
if(physicsTemplate.isAngularlyStatic()){
|
||||||
|
Globals.clientSceneWrapper.getCollisionEngine().setAngularlyStatic(rigidBody, true);
|
||||||
|
}
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_COLLISION_BODY_TRANSFORM, offsetTransform);
|
rVal.putData(EntityDataStrings.PHYSICS_COLLISION_BODY_TRANSFORM, offsetTransform);
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_MODEL_TEMPLATE, physicsTemplate);
|
rVal.putData(EntityDataStrings.PHYSICS_MODEL_TEMPLATE, physicsTemplate);
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_COLLIDABLE, collidable);
|
rVal.putData(EntityDataStrings.PHYSICS_COLLIDABLE, collidable);
|
||||||
@ -80,6 +83,9 @@ public class PhysicsEntityUtils {
|
|||||||
physicsTemplate.getRotX(), physicsTemplate.getRotY(), physicsTemplate.getRotZ(), physicsTemplate.getRotW(), //rotate
|
physicsTemplate.getRotX(), physicsTemplate.getRotY(), physicsTemplate.getRotZ(), physicsTemplate.getRotW(), //rotate
|
||||||
1, 1, 1 //scale
|
1, 1, 1 //scale
|
||||||
);
|
);
|
||||||
|
if(physicsTemplate.isAngularlyStatic()){
|
||||||
|
Globals.clientSceneWrapper.getCollisionEngine().setAngularlyStatic(rigidBody, true);
|
||||||
|
}
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_COLLISION_BODY_TRANSFORM, offsetTransform);
|
rVal.putData(EntityDataStrings.PHYSICS_COLLISION_BODY_TRANSFORM, offsetTransform);
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_MODEL_TEMPLATE, physicsTemplate);
|
rVal.putData(EntityDataStrings.PHYSICS_MODEL_TEMPLATE, physicsTemplate);
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_COLLIDABLE, collidable);
|
rVal.putData(EntityDataStrings.PHYSICS_COLLIDABLE, collidable);
|
||||||
@ -129,6 +135,9 @@ public class PhysicsEntityUtils {
|
|||||||
physicsTemplate.getRotX(), physicsTemplate.getRotY(), physicsTemplate.getRotZ(), physicsTemplate.getRotW(), //rotate
|
physicsTemplate.getRotX(), physicsTemplate.getRotY(), physicsTemplate.getRotZ(), physicsTemplate.getRotW(), //rotate
|
||||||
1, 1, 1 //scale
|
1, 1, 1 //scale
|
||||||
);
|
);
|
||||||
|
if(physicsTemplate.isAngularlyStatic()){
|
||||||
|
realm.getCollisionEngine().setAngularlyStatic(rigidBody, true);
|
||||||
|
}
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_COLLISION_BODY_TRANSFORM, offsetTransform);
|
rVal.putData(EntityDataStrings.PHYSICS_COLLISION_BODY_TRANSFORM, offsetTransform);
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_MODEL_TEMPLATE, physicsTemplate);
|
rVal.putData(EntityDataStrings.PHYSICS_MODEL_TEMPLATE, physicsTemplate);
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_COLLIDABLE, collidable);
|
rVal.putData(EntityDataStrings.PHYSICS_COLLIDABLE, collidable);
|
||||||
@ -149,6 +158,9 @@ public class PhysicsEntityUtils {
|
|||||||
physicsTemplate.getRotX(), physicsTemplate.getRotY(), physicsTemplate.getRotZ(), physicsTemplate.getRotW(), //rotate
|
physicsTemplate.getRotX(), physicsTemplate.getRotY(), physicsTemplate.getRotZ(), physicsTemplate.getRotW(), //rotate
|
||||||
1, 1, 1 //scale
|
1, 1, 1 //scale
|
||||||
);
|
);
|
||||||
|
if(physicsTemplate.isAngularlyStatic()){
|
||||||
|
realm.getCollisionEngine().setAngularlyStatic(rigidBody, true);
|
||||||
|
}
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_COLLISION_BODY_TRANSFORM, offsetTransform);
|
rVal.putData(EntityDataStrings.PHYSICS_COLLISION_BODY_TRANSFORM, offsetTransform);
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_MODEL_TEMPLATE, physicsTemplate);
|
rVal.putData(EntityDataStrings.PHYSICS_MODEL_TEMPLATE, physicsTemplate);
|
||||||
rVal.putData(EntityDataStrings.PHYSICS_COLLIDABLE, collidable);
|
rVal.putData(EntityDataStrings.PHYSICS_COLLIDABLE, collidable);
|
||||||
|
|||||||
@ -39,7 +39,6 @@ public class ClientAlwaysUprightTree implements BehaviorTree {
|
|||||||
Vector3d angularForce = new Vector3d();
|
Vector3d angularForce = new Vector3d();
|
||||||
|
|
||||||
//make sure rotation is vertical
|
//make sure rotation is vertical
|
||||||
body.setMaxAngularSpeed(0);
|
|
||||||
// sourceRotation = sourceRotation.mul(0.001, 1, 0.001, 1).normalize();
|
// sourceRotation = sourceRotation.mul(0.001, 1, 0.001, 1).normalize();
|
||||||
|
|
||||||
EntityUtils.getPosition(parent).set(position);
|
EntityUtils.getPosition(parent).set(position);
|
||||||
|
|||||||
@ -42,7 +42,6 @@ public class ServerAlwaysUprightTree implements BehaviorTree {
|
|||||||
Vector3d angularForce = new Vector3d();
|
Vector3d angularForce = new Vector3d();
|
||||||
|
|
||||||
//make sure rotation is vertical
|
//make sure rotation is vertical
|
||||||
body.setMaxAngularSpeed(0);
|
|
||||||
// sourceRotation = sourceRotation.mul(0.001, 0.001, 0.001, 1).normalize();
|
// sourceRotation = sourceRotation.mul(0.001, 0.001, 0.001, 1).normalize();
|
||||||
|
|
||||||
EntityUtils.getPosition(parent).set(position);
|
EntityUtils.getPosition(parent).set(position);
|
||||||
|
|||||||
@ -20,6 +20,11 @@ public class CollidableTemplate {
|
|||||||
float offsetY;
|
float offsetY;
|
||||||
float offsetZ;
|
float offsetZ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Controls whether the body can rotate or not
|
||||||
|
*/
|
||||||
|
boolean angularlyStatic;
|
||||||
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
@ -63,6 +68,14 @@ public class CollidableTemplate {
|
|||||||
public float getOffsetZ() {
|
public float getOffsetZ() {
|
||||||
return offsetZ;
|
return offsetZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets if the body should always be allowed to rotate or not
|
||||||
|
* @return true if should always be allowed to rotate, false otherwise
|
||||||
|
*/
|
||||||
|
public boolean isAngularlyStatic(){
|
||||||
|
return this.angularlyStatic;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user