diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-01-27 03:49:13 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-01-27 03:49:13 +0400 |
commit | 556912792ad3c37c294256a558c96b39f264e7b5 (patch) | |
tree | 9b6ee8cf1ad92ee89c04f27a89be11599c5b40c0 /source/gameengine/Expressions/Operator2Expr.cpp | |
parent | 9251d628db0abe599d927d79170025d8545c8ace (diff) | |
parent | c84383301c5a2582e95259a7e4468a23a3566401 (diff) |
Merged changes in the trunk up to revision 54110.
Conflicts resolved:
source/blender/blenfont/SConscript
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/intern/rna_scene.c
Diffstat (limited to 'source/gameengine/Expressions/Operator2Expr.cpp')
-rw-r--r-- | source/gameengine/Expressions/Operator2Expr.cpp | 83 |
1 files changed, 42 insertions, 41 deletions
diff --git a/source/gameengine/Expressions/Operator2Expr.cpp b/source/gameengine/Expressions/Operator2Expr.cpp index d0240b5ec75..b03d00e7f77 100644 --- a/source/gameengine/Expressions/Operator2Expr.cpp +++ b/source/gameengine/Expressions/Operator2Expr.cpp @@ -113,61 +113,61 @@ and m_rhs } -/* +#if 0 bool COperator2Expr::IsInside(float x, float y, float z,bool bBorderInclude) { bool inside; inside = false; - switch (m_op) - { - case VALUE_ADD_OPERATOR: { - // inside = first || second; // optimized with early out if first is inside - // todo: calculate smallest leaf first ! is much faster... - - bool second;//first ;//,second; - - //first = m_lhs->IsInside(x,y,z); - second = m_rhs->IsInside(x,y,z,bBorderInclude); - if (second) - return true; //early out - - // second = m_rhs->IsInside(x,y,z); + switch (m_op) { + case VALUE_ADD_OPERATOR: + { + // inside = first || second; // optimized with early out if first is inside + // todo: calculate smallest leaf first ! is much faster... - return m_lhs->IsInside(x,y,z,bBorderInclude); - - break; - } - - case VALUE_SUB_OPERATOR: { - //inside = first && !second; // optimized with early out - // todo: same as with add_operator: calc smallest leaf first + bool second;//first ;//,second; - bool second;//first ;//,second; - //first = m_lhs->IsInside(x,y,z); - second = m_rhs->IsInside(x,y,z,bBorderInclude); - if (second) - return false; + //first = m_lhs->IsInside(x,y,z); + second = m_rhs->IsInside(x,y,z,bBorderInclude); + if (second) + return true; //early out - // second space get subtracted -> negate! - //second = m_rhs->IsInside(x,y,z); + // second = m_rhs->IsInside(x,y,z); - return (m_lhs->IsInside(x,y,z,bBorderInclude)); + return m_lhs->IsInside(x,y,z,bBorderInclude); - - break; - } - default:{ - assert(false); - // not yet implemented, only add or sub csg operations - } + break; + } + + case VALUE_SUB_OPERATOR: + { + //inside = first && !second; // optimized with early out + // todo: same as with add_operator: calc smallest leaf first + + bool second;//first ;//,second; + //first = m_lhs->IsInside(x,y,z); + second = m_rhs->IsInside(x,y,z,bBorderInclude); + if (second) + return false; + + // second space get subtracted -> negate! + //second = m_rhs->IsInside(x,y,z); + + return (m_lhs->IsInside(x,y,z,bBorderInclude)); + + + break; + } + default: + { + assert(false); + // not yet implemented, only add or sub csg operations + } } return inside; } - - bool COperator2Expr::IsRightInside(float x, float y, float z,bool bBorderInclude) { return m_rhs->IsInside(x,y,z,bBorderInclude); @@ -177,7 +177,8 @@ bool COperator2Expr::IsLeftInside(float x, float y, float z,bool bBorderInclude) { return m_lhs->IsInside(x,y,z,bBorderInclude); } -*/ +#endif + bool COperator2Expr::NeedsRecalculated() { // added some lines, just for debugging purposes, it could be a one-liner :) |