~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/gameengine/Expressions/Operator2Expr.cpp

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
                
103
103
                m_cached_calculate = ffleft->Calc(m_op,ffright);
104
104
                
105
 
                //if (m_cached_calculate)                               
 
105
                //if (m_cached_calculate)
106
106
                //      m_cached_calculate->Action(CValue::SETOWNEREXPR,&CVoidValue(this,false,CValue::STACKVALUE));
107
107
 
108
108
                ffleft->Release();
113
113
        
114
114
}
115
115
 
116
 
/*
 
116
#if 0
117
117
bool COperator2Expr::IsInside(float x, float y, float z,bool bBorderInclude)
118
118
{
119
119
        bool inside;
120
120
        inside = false;
121
121
        
122
 
        switch (m_op) 
123
 
        {
124
 
        case VALUE_ADD_OPERATOR: {
125
 
        //      inside = first || second; // optimized with early out if first is inside
126
 
                // todo: calculate smallest leaf first ! is much faster...
127
 
                        
128
 
                bool second;//first ;//,second;
129
 
                
130
 
                //first = m_lhs->IsInside(x,y,z);
131
 
                second = m_rhs->IsInside(x,y,z,bBorderInclude);
132
 
                if (second)
133
 
                        return true; //early out
134
 
        
135
 
        //      second = m_rhs->IsInside(x,y,z);
136
 
 
137
 
                return m_lhs->IsInside(x,y,z,bBorderInclude);
138
 
                        
139
 
                break;
140
 
                                                         }
141
 
                
142
 
        case VALUE_SUB_OPERATOR: {
143
 
                //inside = first && !second; // optimized with early out
144
 
                // todo: same as with add_operator: calc smallest leaf first
145
 
 
146
 
                bool second;//first ;//,second;
147
 
                //first = m_lhs->IsInside(x,y,z);
148
 
                second = m_rhs->IsInside(x,y,z,bBorderInclude);
149
 
                if (second)
150
 
                        return false;
151
 
 
152
 
                // second space get subtracted -> negate!
153
 
                //second = m_rhs->IsInside(x,y,z);
154
 
 
155
 
                return (m_lhs->IsInside(x,y,z,bBorderInclude));
156
 
 
157
 
                
158
 
                break;
159
 
                                                         }
160
 
        default:{
161
 
                assert(false);
162
 
                // not yet implemented, only add or sub csg operations
163
 
                        }
 
122
        switch (m_op) {
 
123
                case VALUE_ADD_OPERATOR:
 
124
                {
 
125
                        //      inside = first || second; // optimized with early out if first is inside
 
126
                        // todo: calculate smallest leaf first ! is much faster...
 
127
 
 
128
                        bool second;//first ;//,second;
 
129
 
 
130
                        //first = m_lhs->IsInside(x,y,z);
 
131
                        second = m_rhs->IsInside(x,y,z,bBorderInclude);
 
132
                        if (second)
 
133
                                return true; //early out
 
134
 
 
135
                        //      second = m_rhs->IsInside(x,y,z);
 
136
 
 
137
                        return m_lhs->IsInside(x,y,z,bBorderInclude);
 
138
 
 
139
                        break;
 
140
                }
 
141
 
 
142
                case VALUE_SUB_OPERATOR:
 
143
                {
 
144
                        //inside = first && !second; // optimized with early out
 
145
                        // todo: same as with add_operator: calc smallest leaf first
 
146
 
 
147
                        bool second;//first ;//,second;
 
148
                        //first = m_lhs->IsInside(x,y,z);
 
149
                        second = m_rhs->IsInside(x,y,z,bBorderInclude);
 
150
                        if (second)
 
151
                                return false;
 
152
 
 
153
                        // second space get subtracted -> negate!
 
154
                        //second = m_rhs->IsInside(x,y,z);
 
155
 
 
156
                        return (m_lhs->IsInside(x,y,z,bBorderInclude));
 
157
 
 
158
 
 
159
                        break;
 
160
                }
 
161
                default:
 
162
                {
 
163
                        assert(false);
 
164
                        // not yet implemented, only add or sub csg operations
 
165
                }
164
166
        }
165
167
        
166
 
        return inside;  
 
168
        return inside;
167
169
}
168
170
 
169
 
 
170
 
 
171
171
bool COperator2Expr::IsRightInside(float x, float y, float z,bool bBorderInclude)
172
172
{
173
173
        return m_rhs->IsInside(x,y,z,bBorderInclude);
177
177
{
178
178
        return m_lhs->IsInside(x,y,z,bBorderInclude);
179
179
}
180
 
*/
 
180
#endif
 
181
 
181
182
bool COperator2Expr::NeedsRecalculated()
182
183
{
183
184
        // added some lines, just for debugging purposes, it could be a one-liner :)
241
242
        
242
243
        if (m_rhs)
243
244
                return Release(m_rhs->AddRef());
244
 
/               
 
245
/
245
246
 
246
247
  */
247
248
        return Release();