Mouse events bubbling fixed

This commit is contained in:
Yaski
2012-07-24 19:50:45 +06:00
parent bddeffa66a
commit 18c0e916b8
3 changed files with 3 additions and 5 deletions

View File

@@ -236,14 +236,12 @@ public class Camera3D extends Object3D {
// Check if object of hierarchy is visible // Check if object of hierarchy is visible
if (root.visible) { if (root.visible) {
globalMouseHandlingType = 0;
// Calculating the matrix to transform from the camera space to local space // Calculating the matrix to transform from the camera space to local space
root.cameraToLocalTransform.combine(root.inverseTransform, localToGlobalTransform); root.cameraToLocalTransform.combine(root.inverseTransform, localToGlobalTransform);
// Calculating the matrix to transform from local space to the camera space // Calculating the matrix to transform from local space to the camera space
root.localToCameraTransform.combine(globalToLocalTransform, root.transform); root.localToCameraTransform.combine(globalToLocalTransform, root.transform);
if (root.mouseEnabled) globalMouseHandlingType |= root.mouseHandlingType; globalMouseHandlingType = root.mouseHandlingType;
// Checking the culling // Checking the culling
if (root.boundBox != null) { if (root.boundBox != null) {
calculateFrustum(root.cameraToLocalTransform); calculateFrustum(root.cameraToLocalTransform);

View File

@@ -1523,7 +1523,7 @@ package alternativa.engine3d.core {
// Calculating matrix for converting from local coordinates to camera coordinates // Calculating matrix for converting from local coordinates to camera coordinates
child.localToCameraTransform.combine(localToCameraTransform, child.transform); child.localToCameraTransform.combine(localToCameraTransform, child.transform);
if (child.mouseEnabled) camera.globalMouseHandlingType |= child.mouseHandlingType; camera.globalMouseHandlingType |= child.mouseHandlingType;
// Culling checking // Culling checking
if (child.boundBox != null) { if (child.boundBox != null) {
camera.calculateFrustum(child.cameraToLocalTransform); camera.calculateFrustum(child.cameraToLocalTransform);

View File

@@ -196,7 +196,7 @@ package alternativa.engine3d.objects {
// Calculation of transfer matrix from local space to camera. // Calculation of transfer matrix from local space to camera.
child.localToCameraTransform.combine(parent.localToCameraTransform, child.transform); child.localToCameraTransform.combine(parent.localToCameraTransform, child.transform);
if (child.mouseEnabled) camera.globalMouseHandlingType |= child.mouseHandlingType; camera.globalMouseHandlingType |= child.mouseHandlingType;
// Pass // Pass
child.culling = parent.culling; child.culling = parent.culling;
// Calculating visibility of the self content // Calculating visibility of the self content