first person camera
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
ac12b3f5a8
commit
baf7bf976d
@ -266,6 +266,13 @@ Clean up data
|
|||||||
- Tree Model Paths
|
- Tree Model Paths
|
||||||
|
|
||||||
|
|
||||||
|
(05/07/2024)
|
||||||
|
Ground Texture Atlas system
|
||||||
|
- Refactor to block main thread only when creating the actual texture object (load buffered image separately)
|
||||||
|
|
||||||
|
First Person Camera
|
||||||
|
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
Character movement in particular feels off
|
Character movement in particular feels off
|
||||||
@ -292,9 +299,6 @@ Data Cleanup
|
|||||||
Clean up Material class
|
Clean up Material class
|
||||||
- fix storing textures in the mat class ( pain :c )
|
- fix storing textures in the mat class ( pain :c )
|
||||||
|
|
||||||
Ground Texture Atlas system
|
|
||||||
- Refactor to block main thread only when creating the actual texture object (load buffered image separately)
|
|
||||||
|
|
||||||
More Debug menus
|
More Debug menus
|
||||||
- Screen that shows the overall status of draw cell manager
|
- Screen that shows the overall status of draw cell manager
|
||||||
- Screen that shows the overall status of fluid cell manager
|
- Screen that shows the overall status of fluid cell manager
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import org.ode4j.ode.DRay;
|
|||||||
import org.ode4j.ode.OdeHelper;
|
import org.ode4j.ode.OdeHelper;
|
||||||
|
|
||||||
import electrosphere.collision.collidable.Collidable;
|
import electrosphere.collision.collidable.Collidable;
|
||||||
|
import electrosphere.engine.Globals;
|
||||||
import electrosphere.entity.Entity;
|
import electrosphere.entity.Entity;
|
||||||
|
|
||||||
public class RayCastCallback implements DNearCallback {
|
public class RayCastCallback implements DNearCallback {
|
||||||
@ -82,7 +83,8 @@ void RayCallback(void *Data, dGeomID Geometry1, dGeomID Geometry2) {
|
|||||||
(o2 instanceof DRay && rayCastData.collidableTypeMask.contains(collidable1.getType()))
|
(o2 instanceof DRay && rayCastData.collidableTypeMask.contains(collidable1.getType()))
|
||||||
)
|
)
|
||||||
) ||
|
) ||
|
||||||
rayCastData.collidableTypeMask == null
|
rayCastData.collidableTypeMask == null &&
|
||||||
|
collidable2 != null && collidable2.getParent() != Globals.playerEntity //don't self cast -- should work on both server and client
|
||||||
){
|
){
|
||||||
//calculate collisions
|
//calculate collisions
|
||||||
int numc = OdeHelper.collide(o1,o2,MAX_CONTACTS,contacts.getGeomBuffer());
|
int numc = OdeHelper.collide(o1,o2,MAX_CONTACTS,contacts.getGeomBuffer());
|
||||||
|
|||||||
@ -221,6 +221,9 @@ public class ControlHandler {
|
|||||||
|
|
||||||
boolean shouldRecaptureScreen = false;
|
boolean shouldRecaptureScreen = false;
|
||||||
|
|
||||||
|
//controls whether the camera is first or third person
|
||||||
|
boolean cameraIsThirdPerson = false;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Mouse event parsing related stuff
|
Mouse event parsing related stuff
|
||||||
@ -1641,6 +1644,14 @@ public class ControlHandler {
|
|||||||
public boolean shouldRecapture(){
|
public boolean shouldRecapture(){
|
||||||
return this.shouldRecaptureScreen;
|
return this.shouldRecaptureScreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the camera is third person
|
||||||
|
* @return true if third person, false if first person
|
||||||
|
*/
|
||||||
|
public boolean cameraIsThirdPerson(){
|
||||||
|
return cameraIsThirdPerson;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -176,7 +176,11 @@ public class ClientLoading {
|
|||||||
Player Camera
|
Player Camera
|
||||||
|
|
||||||
*/
|
*/
|
||||||
Globals.playerCamera = CameraEntityUtils.spawnPlayerEntityTrackingCameraEntity(new Vector3f(1,0,1), new Vector3f(0,0,1));
|
if(Globals.controlHandler.cameraIsThirdPerson()){
|
||||||
|
Globals.playerCamera = CameraEntityUtils.spawnPlayerEntityTrackingCameraEntity(new Vector3f(1,0,1), new Vector3f(0,0,1));
|
||||||
|
} else {
|
||||||
|
Globals.playerCamera = CameraEntityUtils.spawnPlayerEntityTrackingCameraFirstPersonEntity(new Vector3f(1,0,1), new Vector3f(0,0,1));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import org.joml.Vector3d;
|
|||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
import electrosphere.entity.ClientEntityUtils;
|
import electrosphere.entity.ClientEntityUtils;
|
||||||
import electrosphere.entity.Entity;
|
import electrosphere.entity.Entity;
|
||||||
|
import electrosphere.entity.EntityDataStrings;
|
||||||
import electrosphere.entity.EntityUtils;
|
import electrosphere.entity.EntityUtils;
|
||||||
import electrosphere.entity.state.attack.ClientAttackTree;
|
import electrosphere.entity.state.attack.ClientAttackTree;
|
||||||
import electrosphere.entity.state.attack.ServerAttackTree;
|
import electrosphere.entity.state.attack.ServerAttackTree;
|
||||||
@ -106,6 +107,11 @@ public class EntityProtocol {
|
|||||||
if(Globals.clientPlayer != null && message.getpropertyValue() == Globals.clientPlayer.getId()){
|
if(Globals.clientPlayer != null && message.getpropertyValue() == Globals.clientPlayer.getId()){
|
||||||
Globals.clientCharacterID = message.getentityID();
|
Globals.clientCharacterID = message.getentityID();
|
||||||
Globals.playerEntity = target;
|
Globals.playerEntity = target;
|
||||||
|
if(Globals.controlHandler.cameraIsThirdPerson()){
|
||||||
|
Globals.playerEntity.putData(EntityDataStrings.DATA_STRING_DRAW, true);
|
||||||
|
} else {
|
||||||
|
Globals.playerEntity.putData(EntityDataStrings.DATA_STRING_DRAW, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user