Add Geometries
This commit is contained in:
@@ -164,13 +164,12 @@ int main()
|
||||
|
||||
{ // test parent-child relationship
|
||||
ContainerBox Parent;
|
||||
Parent.SetOrigin(Vector3f(1,1,1));
|
||||
Parent.SetSize(Vector3f(2,2,2));
|
||||
Parent.SetPosition(Vector3f(1,1,1));
|
||||
Parent.Scale(Vector3f(2,2,2));
|
||||
|
||||
ContainerBox Child;
|
||||
Child.SetParent(&Parent);
|
||||
Child.SetOrigin(Vector3f(1,1,1));
|
||||
Child.SetSize(Vector3f(2,2,2));
|
||||
Child.SetPosition(Vector3f(0,0,0));
|
||||
|
||||
HPoint3f pt = Child.GetLocalPoint(HPoint3f(0,0,0));
|
||||
HPoint3f wp = Child.GetWorldPoint(pt);
|
||||
@@ -178,16 +177,18 @@ int main()
|
||||
|
||||
pt = HPoint3f(1,1,1);
|
||||
wp = Child.GetWorldPoint(pt);
|
||||
TEST0( Vector4f0(wp - HPoint3f(2,2,2)) );
|
||||
TEST0( Vector4f0(wp - HPoint3f(3,3,3)) );
|
||||
|
||||
pt = HPoint3f(1,2,3);
|
||||
Parent.Rotate(Vector3f(M_PI,0,0));
|
||||
pt = HPoint3f(1,1,1);
|
||||
wp = Child.GetWorldPoint(pt);
|
||||
std::cout << "Child.GetWorldPoint(HPoint3f(1,2,3)): " << wp << std::endl;
|
||||
TEST0( Vector4f0(wp - HPoint3f(2,3,4)) );
|
||||
TEST0( Vector4f0(wp - HPoint3f(3,-1,-1)) );
|
||||
|
||||
pt = HPoint3f(1,2,3);
|
||||
Child.Rotate(Vector3f(M_PI,0,0));
|
||||
pt = HPoint3f(1,1,1);
|
||||
wp = Child.GetWorldPoint(pt);
|
||||
TEST0( Vector4f0(wp - HPoint3f(2,3,4)) );
|
||||
TEST0( Vector4f0(wp - HPoint3f(3,3,3)) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user