feat(physics): add rigidbody velocity control
This commit is contained in:
@@ -18,6 +18,8 @@ TEST(PhysicsComponents_Test, Rigidbody_SerializeRoundTripPreservesFields) {
|
||||
source.SetMass(3.5f);
|
||||
source.SetLinearDamping(0.2f);
|
||||
source.SetAngularDamping(0.8f);
|
||||
source.SetLinearVelocity(XCEngine::Math::Vector3(1.0f, 2.0f, 3.0f));
|
||||
source.SetAngularVelocity(XCEngine::Math::Vector3(-4.0f, 5.0f, -6.0f));
|
||||
source.SetUseGravity(false);
|
||||
source.SetEnableCCD(true);
|
||||
|
||||
@@ -31,6 +33,8 @@ TEST(PhysicsComponents_Test, Rigidbody_SerializeRoundTripPreservesFields) {
|
||||
EXPECT_FLOAT_EQ(target.GetMass(), 3.5f);
|
||||
EXPECT_FLOAT_EQ(target.GetLinearDamping(), 0.2f);
|
||||
EXPECT_FLOAT_EQ(target.GetAngularDamping(), 0.8f);
|
||||
EXPECT_EQ(target.GetLinearVelocity(), XCEngine::Math::Vector3(1.0f, 2.0f, 3.0f));
|
||||
EXPECT_EQ(target.GetAngularVelocity(), XCEngine::Math::Vector3(-4.0f, 5.0f, -6.0f));
|
||||
EXPECT_FALSE(target.GetUseGravity());
|
||||
EXPECT_TRUE(target.GetEnableCCD());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user