Fixed various physics bugs and added Physics Material to Inspector #249

Merged
direnbharwani merged 7 commits from SP3-2-Physics into main 2022-11-22 20:14:31 +08:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit 23bae3d515 - Show all commits

View File

@ -359,6 +359,10 @@ RTTR_REGISTRATION
); );
registration::class_<SHCollisionShape>("Collider") registration::class_<SHCollisionShape>("Collider")
.property("Position Offset", &SHCollisionShape::GetPositionOffset, &SHCollisionShape::SetPositionOffset) .property("IsTrigger" , &SHCollisionShape::IsTrigger , &SHCollisionShape::SetIsTrigger )
.property("Rotation Offset", &SHCollisionShape::GetRotationOffset, &SHCollisionShape::SetRotationOffset) (metadata(META::angleInRad, true)); .property("Friction" , &SHCollisionShape::GetFriction , &SHCollisionShape::SetFriction )
.property("Bounciness" , &SHCollisionShape::GetBounciness , &SHCollisionShape::SetBounciness )
.property("Density" , &SHCollisionShape::GetDensity , &SHCollisionShape::SetDensity )
.property("Position Offset" , &SHCollisionShape::GetPositionOffset, &SHCollisionShape::SetPositionOffset)
.property("Rotation Offset" , &SHCollisionShape::GetRotationOffset, &SHCollisionShape::SetRotationOffset) (metadata(META::angleInRad, true));
} }

View File

@ -188,7 +188,7 @@ namespace YAML
if (node[Friction].IsDefined()) if (node[Friction].IsDefined())
rhs.SetFriction(node[Friction].as<float>()); rhs.SetFriction(node[Friction].as<float>());
if (node[Bounciness].IsDefined()) if (node[Bounciness].IsDefined())
rhs.SetBounciness(rhs.GetBounciness()); rhs.SetBounciness(node[Bounciness].as<float>());
if (node[Density].IsDefined()) if (node[Density].IsDefined())
rhs.SetDensity(node[Density].as<float>()); rhs.SetDensity(node[Density].as<float>());
if (node[PositionOffset].IsDefined()) if (node[PositionOffset].IsDefined())