Projectile2DTests ObjectAffixedToPhysicsBody Method Delta Engine Documentation

Namespace: DeltaEngine.Physics2D.Tests
Assembly: DeltaEngine.Physics2D.Tests (in DeltaEngine.Physics2D.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void ObjectAffixedToPhysicsBody()
Examples

[Test, CloseAfterFirstFrame]
public void ObjectAffixedToPhysicsBody()
{
    var bullet = CreateBullet(Vector2D.Zero, 0);
    var physicsBody = bullet.Get<PhysicsBody>();
    physicsBody.Position = Vector2D.One;
    physicsBody.Rotation = 10;
    AdvanceTimeAndUpdateEntities();
    Assert.AreEqual(10, bullet.Rotation);
    Assert.AreEqual(1.0f, bullet.Center.X, 0.01f);
    Assert.AreEqual(1.0f, bullet.Center.Y, 0.01f);
}
See Also