mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Fix transform handling and projection culling
Now to figure out why my collider is disappearing...
This commit is contained in:
@ -45,9 +45,9 @@ namespace ConformalDecals {
|
||||
}
|
||||
}
|
||||
|
||||
public void Project(Matrix4x4 orthoMatrix, Bounds projectorBounds, Transform projector) {
|
||||
public void Project(Matrix4x4 orthoMatrix, OrientedBounds projectorBounds, Transform projector) {
|
||||
var targetBounds = _targetRenderer.bounds;
|
||||
if (targetBounds.Intersects(projectorBounds)) {
|
||||
if (projectorBounds.Intersects(targetBounds)) {
|
||||
_projectionEnabled = true;
|
||||
var projectorToTargetMatrix = target.worldToLocalMatrix * projector.localToWorldMatrix;
|
||||
|
||||
@ -58,9 +58,11 @@ namespace ConformalDecals {
|
||||
decalMPB.SetMatrix(_projectionMatrixID, projectionMatrix);
|
||||
decalMPB.SetVector(_decalNormalID, decalNormal);
|
||||
decalMPB.SetVector(_decalTangentID, decalTangent);
|
||||
Debug.Log($"Projection enabled for {target.gameObject}");
|
||||
}
|
||||
else {
|
||||
_projectionEnabled = false;
|
||||
Debug.Log($"Projection disabled for {target.gameObject}");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user