def testElementWriteAccess(self): vector = gm.Vec4f() vector[0] = 0.0 vector[1] = 2.0 vector[2] = 4.0 vector[3] = 6.0 self.assertAlmostEqual(vector[0], 0.0) self.assertAlmostEqual(vector[1], 2.0) self.assertAlmostEqual(vector[2], 4.0) self.assertAlmostEqual(vector[3], 6.0)
def testVec4f(self): vectorA = gm.Vec4f(0.0, 1.0, 2.0, 3.0); vectorB = gm.Vec4f(0.0, 5.0, 10.0, 15.0); self.assertEqual(gm.DotProduct(vectorA, vectorB), 70.0);
def testMinMaxInitialization(self): gm.Vec4fRange( gm.Vec4f(), gm.Vec4f(), )
def testDefaultInitialization(self): vector = gm.Vec4f() self.assertEqual(vector, gm.Vec4f(0.0, 0.0, 0.0, 0.0))
def testNamedElementWriteAccessW(self): vector = gm.Vec4f() vector.w = 3 self.assertEqual(vector[3], 3)
def testNamedElementReadAccessW(self): vector = gm.Vec4f(0.0, 1.0, 2.0, 3.0) self.assertEqual(vector.w, 3)
def testNamedElementWriteAccessZ(self): vector = gm.Vec4f() vector.z = 2 self.assertEqual(vector[2], 2)
def testNamedElementWriteAccessY(self): vector = gm.Vec4f() vector.y = 1 self.assertEqual(vector[1], 1)
def testNamedElementWriteAccessX(self): vector = gm.Vec4f() vector.x = 0 self.assertEqual(vector[0], 0)
def testElementReadAccess(self): vector = gm.Vec4f(0.0, 2.0, 4.0, 6.0) self.assertAlmostEqual(vector[0], 0.0) self.assertAlmostEqual(vector[1], 2.0) self.assertAlmostEqual(vector[2], 4.0) self.assertAlmostEqual(vector[3], 6.0)
def testElementInitialization(self): gm.Vec4f(0.0, 2.0, 4.0, 6.0)