Fixed bug with non-dynamic masses being overriden
This commit is contained in:
parent
d109d06764
commit
92ed8a29ff
|
@ -72,7 +72,7 @@
|
||||||
RigidBody Component:
|
RigidBody Component:
|
||||||
Type: Static
|
Type: Static
|
||||||
Auto Mass: false
|
Auto Mass: false
|
||||||
Mass: 1
|
Mass: .inf
|
||||||
Drag: 0.00999999978
|
Drag: 0.00999999978
|
||||||
Angular Drag: 0.00999999978
|
Angular Drag: 0.00999999978
|
||||||
Use Gravity: false
|
Use Gravity: false
|
||||||
|
|
|
@ -319,6 +319,7 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
if (bodyType != Type::DYNAMIC)
|
if (bodyType != Type::DYNAMIC)
|
||||||
{
|
{
|
||||||
|
invMass = 0.0f;
|
||||||
SHLOG_WARNING("Cannot set mass of a non-Dynamic Body {}", entityID)
|
SHLOG_WARNING("Cannot set mass of a non-Dynamic Body {}", entityID)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace SHADE
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
SHRigidBodyComponent::SHRigidBodyComponent() noexcept
|
SHRigidBodyComponent::SHRigidBodyComponent() noexcept
|
||||||
: type { Type::STATIC }
|
: type { Type::DYNAMIC }
|
||||||
, interpolate { true }
|
, interpolate { true }
|
||||||
, rigidBody { nullptr }
|
, rigidBody { nullptr }
|
||||||
{}
|
{}
|
||||||
|
|
Loading…
Reference in New Issue