Format
This commit is contained in:
parent
e2d03642f4
commit
394ff3b0ae
7 changed files with 20 additions and 20 deletions
|
@ -34,8 +34,8 @@ int CappedCylinder::findRayIntersection(const InfiniteRay &ray, Vector3 *first_i
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
} else // count == 1
|
||||
{
|
||||
} else {
|
||||
// count == 1
|
||||
if (checkPointProjection(first_intersection)) {
|
||||
return 1;
|
||||
} else {
|
||||
|
|
|
@ -60,19 +60,19 @@ bool SpaceSegment::intersectBoundingBox(const SpaceSegment &bbox) const {
|
|||
double tmax = min(min(max(t1, t2), max(t3, t4)), max(t5, t6));
|
||||
|
||||
// if tmax < 0, ray (line) is intersecting AABB, but whole AABB is behing us
|
||||
//double t;
|
||||
// double t;
|
||||
if (tmax < 0.0) {
|
||||
//t = tmax;
|
||||
// t = tmax;
|
||||
return false;
|
||||
}
|
||||
|
||||
// if tmin > tmax, ray doesn't intersect AABB
|
||||
if (tmin > tmax) {
|
||||
//t = tmax;
|
||||
// t = tmax;
|
||||
return false;
|
||||
}
|
||||
|
||||
//t = tmin;
|
||||
// t = tmin;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
VegetationModelDefinition::VegetationModelDefinition(DefinitionNode *parent) : DefinitionNode(parent, "model") {
|
||||
solid_material = new SurfaceMaterial(Color(0.2, 0.15, 0.15));
|
||||
solid_material->reflection = 0.002;
|
||||
solid_material->shininess = 2.0;
|
||||
solid_material->shininess = 1.0;
|
||||
solid_material->hardness = 0.3;
|
||||
solid_material->validate();
|
||||
|
||||
foliage_material = new SurfaceMaterial(Color(0.4, 0.8, 0.45));
|
||||
foliage_material->reflection = 0.007;
|
||||
foliage_material->shininess = 12.0;
|
||||
foliage_material->shininess = 2.0;
|
||||
foliage_material->hardness = 0.2;
|
||||
foliage_material->validate();
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ TEST(InfiniteCylinder, getRayIntersection2) {
|
|||
int intersect_count;
|
||||
Vector3 p1, p2;
|
||||
|
||||
intersect_count = cylinder.findRayIntersection(
|
||||
InfiniteRay::fromPoints(Vector3(0.0, 1.5, 0.0), Vector3(0.0, 1.5, 2.0)), &p1, &p2);
|
||||
intersect_count =
|
||||
cylinder.findRayIntersection(InfiniteRay::fromPoints(Vector3(0.0, 1.5, 0.0), Vector3(0.0, 1.5, 2.0)), &p1, &p2);
|
||||
EXPECT_EQ(2, intersect_count);
|
||||
EXPECT_VECTOR3_COORDS(p1, 0.0, 1.5, 0.5);
|
||||
EXPECT_VECTOR3_COORDS(p2, 0.0, 1.5, 1.5);
|
||||
|
|
Loading…
Reference in a new issue