Changeset 1772 for GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
- Timestamp:
- 11/20/06 18:44:29 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/AxisAlignedBox3.cpp
r1768 r1772 2286 2286 } 2287 2287 2288 } 2289 2288 2289 Vector3 AxisAlignedBox3::GetRandomSurfacePoint() const 2290 { 2291 const int idx = Random(6); 2292 2293 const Rectangle3 face = GetFace(idx); 2294 2295 Vector3 point = Vector3(0,0,0); 2296 float sum = 0.0f; 2297 2298 for (int i = 0; i < 4; ++ i) 2299 { 2300 const float r = RandomValue(0, 1); 2301 sum += r; 2302 point += face.mVertices[i] * r; 2303 } 2304 2305 point *= 1.0f / sum; 2306 2307 //normal = face.GetNormal(); 2308 2309 return point; 2310 } 2311 2312 2313 } 2314
Note: See TracChangeset
for help on using the changeset viewer.