mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-02 08:58:07 +00:00
attempt fix camera
This commit is contained in:
parent
ef8c54c195
commit
cc1c8d7950
2 changed files with 5 additions and 3 deletions
|
|
@ -632,9 +632,10 @@ class CameraController extends Object {
|
|||
&& (firstHit == null || (rayCastOrigin.distance(result.point) < firstHitDistance))) {
|
||||
firstHit = result;
|
||||
firstHitDistance = rayCastOrigin.distance(result.point);
|
||||
processedShapes.push(result.object);
|
||||
}
|
||||
}
|
||||
if (firstHit != null)
|
||||
processedShapes.push(firstHit.object);
|
||||
|
||||
if (firstHit != null) {
|
||||
if (firstHitDistance < CameraDistance) {
|
||||
|
|
@ -647,7 +648,7 @@ class CameraController extends Object {
|
|||
var dist = plane.distance(camera.pos.toPoint());
|
||||
|
||||
if (dist >= closeness)
|
||||
break;
|
||||
continue;
|
||||
|
||||
camera.pos = projected.toVector().add(normal.multiply(-closeness));
|
||||
|
||||
|
|
|
|||
|
|
@ -1381,7 +1381,8 @@ class Marble extends GameObject {
|
|||
|
||||
var currentFinalPos = position.add(relVel.multiply(finalT)); // localpos.add(relLocalVel.multiply(finalT));
|
||||
surfaceScratch.resize(0);
|
||||
@:privateAccess obj.grid.boundingSearch(boundThing, surfaceScratch);
|
||||
if (@:privateAccess obj.grid != null)
|
||||
@:privateAccess obj.grid.boundingSearch(boundThing, surfaceScratch);
|
||||
var surfaces = surfaceScratch;
|
||||
|
||||
for (surf in surfaces) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue