public void Test_New() { var phy = new PhysicsSimulator (); // 標準では PPM=64 だがユニットテストに限り PPM=1 で使用する。 Assert.AreEqual (1, PhysicsSimulator.PPM); Assert.IsNotNull (phy.PhysicsWorld); Assert.AreEqual (new Vector3 (0, -9.8f, 0), phy.Gravity); Assert.AreEqual (0, phy.RigidBodyCount); Assert.AreEqual (0, phy.RigidBodies.Count ()); }
public void Test_IsRegistered() { var node = new Node (); var rb = new RigidBody (); rb.AddShape (new SphereShape (1)); rb.Material = new PhysicsMaterial (); node.Attach (rb); var phys = new PhysicsSimulator (); phys.AddRigidBody (node); Assert.AreEqual (true, phys.IsRegistered(node)); }
public void Test_AddRigidBody() { var node = new Node (); var rb = new RigidBody (); rb.AddShape(new SphereShape (1)); rb.Material = new PhysicsMaterial (); node.Attach (rb); var phys = new PhysicsSimulator (); phys.AddRigidBody (node); Assert.AreEqual (1, phys.RigidBodyCount); Assert.AreEqual (1, phys.RigidBodies.Count ()); }