variable collision bits from collidable defns
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
524f328fae
commit
d8a9d660aa
@ -1169,6 +1169,7 @@ Fix block not firing
|
||||
Fix reentrant locking bug
|
||||
Convert server physics cell generation to executor service
|
||||
Simplifying physics cases
|
||||
Allow variable collision bits for collidable entities
|
||||
|
||||
|
||||
# TODO
|
||||
|
||||
@ -63,6 +63,10 @@ public class PhysicsEntityUtils {
|
||||
if(physicsTemplate.getMass() != null){
|
||||
mass = physicsTemplate.getMass();
|
||||
}
|
||||
long categoryBit = Collidable.TYPE_CREATURE_BIT;
|
||||
if(physicsTemplate.getKinematic()){
|
||||
categoryBit = Collidable.TYPE_STATIC_BIT;
|
||||
}
|
||||
switch(physicsTemplate.getType()){
|
||||
case "CYLINDER": {
|
||||
|
||||
@ -72,7 +76,7 @@ public class PhysicsEntityUtils {
|
||||
Globals.clientSceneWrapper.getCollisionEngine(),
|
||||
physicsTemplate.getDimension1(),
|
||||
physicsTemplate.getDimension2(),
|
||||
Collidable.TYPE_CREATURE_BIT
|
||||
categoryBit
|
||||
);
|
||||
if(physicsTemplate.getMass() != null){
|
||||
CollisionBodyCreation.setCylinderMass(
|
||||
@ -135,7 +139,7 @@ public class PhysicsEntityUtils {
|
||||
rigidBody = CollisionBodyCreation.createCubeBody(
|
||||
Globals.clientSceneWrapper.getCollisionEngine(),
|
||||
new Vector3d(physicsTemplate.getDimension1(),physicsTemplate.getDimension2(),physicsTemplate.getDimension3()),
|
||||
Collidable.TYPE_CREATURE_BIT
|
||||
categoryBit
|
||||
);
|
||||
if(physicsTemplate.getMass() != null){
|
||||
CollisionBodyCreation.setBoxMass(
|
||||
@ -199,7 +203,7 @@ public class PhysicsEntityUtils {
|
||||
Globals.clientSceneWrapper.getCollisionEngine(),
|
||||
physicsTemplate.getDimension2(),
|
||||
physicsTemplate.getDimension2() - physicsTemplate.getDimension1() - physicsTemplate.getDimension1(),
|
||||
Collidable.TYPE_CREATURE_BIT
|
||||
categoryBit
|
||||
);
|
||||
if(physicsTemplate.getMass() != null){
|
||||
CollisionBodyCreation.setCapsuleMass(
|
||||
@ -278,6 +282,10 @@ public class PhysicsEntityUtils {
|
||||
if(physicsTemplate.getMass() != null){
|
||||
mass = physicsTemplate.getMass();
|
||||
}
|
||||
long categoryBit = Collidable.TYPE_CREATURE_BIT;
|
||||
if(physicsTemplate.getKinematic()){
|
||||
categoryBit = Collidable.TYPE_STATIC_BIT;
|
||||
}
|
||||
switch(physicsTemplate.getType()){
|
||||
case "CYLINDER": {
|
||||
|
||||
@ -287,7 +295,7 @@ public class PhysicsEntityUtils {
|
||||
realm.getCollisionEngine(),
|
||||
physicsTemplate.getDimension1(),
|
||||
physicsTemplate.getDimension2(),
|
||||
Collidable.TYPE_CREATURE_BIT
|
||||
categoryBit
|
||||
);
|
||||
if(physicsTemplate.getMass() != null){
|
||||
CollisionBodyCreation.setCylinderMass(
|
||||
@ -351,7 +359,7 @@ public class PhysicsEntityUtils {
|
||||
rigidBody = CollisionBodyCreation.createCubeBody(
|
||||
realm.getCollisionEngine(),
|
||||
new Vector3d(physicsTemplate.getDimension1(),physicsTemplate.getDimension2(),physicsTemplate.getDimension3()),
|
||||
Collidable.TYPE_CREATURE_BIT
|
||||
categoryBit
|
||||
);
|
||||
if(physicsTemplate.getMass() != null){
|
||||
CollisionBodyCreation.setBoxMass(
|
||||
@ -415,7 +423,7 @@ public class PhysicsEntityUtils {
|
||||
realm.getCollisionEngine(),
|
||||
physicsTemplate.getDimension2(),
|
||||
physicsTemplate.getDimension2() - physicsTemplate.getDimension1() - physicsTemplate.getDimension1(),
|
||||
Collidable.TYPE_CREATURE_BIT
|
||||
categoryBit
|
||||
);
|
||||
if(physicsTemplate.getMass() != null){
|
||||
CollisionBodyCreation.setCapsuleMass(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user