|
|
@@ -554,18 +554,18 @@ void HandlePostRenderUpdate()
|
|
|
Vector3 rayHitPos = cameraRay.origin + cameraRay.direction * result.distance;
|
|
|
testScene.debugRenderer.AddBoundingBox(BoundingBox(rayHitPos + Vector3(-0.01, -0.01, -0.01), rayHitPos +
|
|
|
Vector3(0.01, 0.01, 0.01)), Color(1.0, 1.0, 1.0), true);
|
|
|
- }
|
|
|
-
|
|
|
- if (input.keyPress['P'])
|
|
|
- {
|
|
|
- DecalSet@ decal = result.drawable.node.GetComponent("DecalSet");
|
|
|
- if (decal is null)
|
|
|
+
|
|
|
+ if (input.mouseButtonPress[MOUSEB_MIDDLE])
|
|
|
{
|
|
|
- decal = result.drawable.node.CreateComponent("DecalSet");
|
|
|
- decal.material = cache.GetResource("Material", "Materials/Test.xml");
|
|
|
+ DecalSet@ decal = result.drawable.node.GetComponent("DecalSet");
|
|
|
+ if (decal is null)
|
|
|
+ {
|
|
|
+ decal = result.drawable.node.CreateComponent("DecalSet");
|
|
|
+ decal.material = cache.GetResource("Material", "Materials/Test.xml");
|
|
|
+ }
|
|
|
+ decal.AddDecal(result.drawable, rayHitPos - cameraNode.worldRotation * Vector3(0, 0, 0.1), cameraNode.worldRotation, 0.1, 1.0, 0.2, Vector2(0, 0), Vector2(1, 1));
|
|
|
}
|
|
|
- decal.AddDecal(result.drawable, rayHitPos - cameraNode.worldRotation * Vector3(0, 0, 0.1), cameraNode.worldRotation, 0.1, 1.0, 0.2, Vector2(0, 0), Vector2(1, 1));
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|