Refactored Raycasting, Added Layers for Raycasting to C#, Fixed Collision Tag Panel #331

Merged
direnbharwani merged 10 commits from SP3-2-Physics into main 2023-02-03 16:26:07 +08:00
6 changed files with 21 additions and 23 deletions
Showing only changes of commit 71f4cdd29e - Show all commits

View File

@ -1,4 +1,4 @@
Start Maximized: true Start Maximized: true
Working Scene ID: 97402985 Working Scene ID: 84373000
Window Size: {x: 1920, y: 1013} Window Size: {x: 1920, y: 1013}
Style: 0 Style: 0

View File

@ -1,4 +1,4 @@
- EID: 65536 - EID: 0
Name: Default Name: Default
IsActive: true IsActive: true
NumberOfChildren: 0 NumberOfChildren: 0
@ -12,9 +12,9 @@
Type: Dynamic Type: Dynamic
Drag: 0.00999999978 Drag: 0.00999999978
Angular Drag: 0.100000001 Angular Drag: 0.100000001
Use Gravity: false Use Gravity: true
Interpolate: true Interpolate: true
Sleeping Enabled: true Sleeping Enabled: false
Freeze Position X: false Freeze Position X: false
Freeze Position Y: false Freeze Position Y: false
Freeze Position Z: false Freeze Position Z: false

View File

@ -1,3 +1,3 @@
Name: x Name: x
ID: 91446183 ID: 84373000
Type: 5 Type: 5

View File

@ -216,7 +216,6 @@ namespace SHADE
{ {
.entityID = rigidBody->GetEID() .entityID = rigidBody->GetEID()
, .bodyType = rigidBody->type , .bodyType = rigidBody->type
, .flags = rigidBody->flags
, .interpolate = rigidBody->interpolate , .interpolate = rigidBody->interpolate
, .drag = rigidBody->drag , .drag = rigidBody->drag
, .angularDrag = rigidBody->angularDrag , .angularDrag = rigidBody->angularDrag
@ -309,14 +308,14 @@ namespace SHADE
// Re-set properties // Re-set properties
rigidBodyComponent->SetGravityEnabled (DEF.flags & SHUtilities::ConvertEnum(SHRigidBodyComponent::Flags::GRAVITY)); rigidBodyComponent->SetGravityEnabled (rigidBodyComponent->IsGravityEnabled());
rigidBodyComponent->SetIsAllowedToSleep (DEF.flags & SHUtilities::ConvertEnum(SHRigidBodyComponent::Flags::SLEEPING)); rigidBodyComponent->SetIsAllowedToSleep (rigidBodyComponent->IsAllowedToSleep());
rigidBodyComponent->SetFreezePositionX (DEF.flags & SHUtilities::ConvertEnum(SHRigidBodyComponent::Flags::LINEAR_X)); rigidBodyComponent->SetFreezePositionX (rigidBodyComponent->GetFreezePositionX());
rigidBodyComponent->SetFreezePositionY (DEF.flags & SHUtilities::ConvertEnum(SHRigidBodyComponent::Flags::LINEAR_Y)); rigidBodyComponent->SetFreezePositionY (rigidBodyComponent->GetFreezePositionY());
rigidBodyComponent->SetFreezePositionZ (DEF.flags & SHUtilities::ConvertEnum(SHRigidBodyComponent::Flags::LINEAR_Z)); rigidBodyComponent->SetFreezePositionZ (rigidBodyComponent->GetFreezePositionZ());
rigidBodyComponent->SetFreezeRotationX (DEF.flags & SHUtilities::ConvertEnum(SHRigidBodyComponent::Flags::ANGULAR_X)); rigidBodyComponent->SetFreezeRotationX (rigidBodyComponent->GetFreezeRotationX());
rigidBodyComponent->SetFreezeRotationY (DEF.flags & SHUtilities::ConvertEnum(SHRigidBodyComponent::Flags::ANGULAR_Y)); rigidBodyComponent->SetFreezeRotationY (rigidBodyComponent->GetFreezeRotationY());
rigidBodyComponent->SetFreezeRotationZ (DEF.flags & SHUtilities::ConvertEnum(SHRigidBodyComponent::Flags::ANGULAR_Z)); rigidBodyComponent->SetFreezeRotationZ (rigidBodyComponent->GetFreezeRotationZ());
rigidBodyComponent->SetInterpolate (DEF.interpolate); rigidBodyComponent->SetInterpolate (DEF.interpolate);
rigidBodyComponent->SetDrag (DEF.drag); rigidBodyComponent->SetDrag (DEF.drag);

View File

@ -47,7 +47,6 @@ namespace SHADE
{ {
EntityID entityID = MAX_EID; EntityID entityID = MAX_EID;
SHRigidBodyComponent::Type bodyType = SHRigidBodyComponent::Type::STATIC; SHRigidBodyComponent::Type bodyType = SHRigidBodyComponent::Type::STATIC;
uint8_t flags = 0; // aZ aY aX lZ lY lX sleepEnabled gravity
bool interpolate = true; bool interpolate = true;
float drag = 0.0f; float drag = 0.0f;
float angularDrag = 0.0f; float angularDrag = 0.0f;

View File

@ -152,14 +152,14 @@ namespace SHADE
enum class Flags : uint8_t enum class Flags : uint8_t
{ {
GRAVITY = 0x0 GRAVITY = 0x1
, SLEEPING = 0x1 , SLEEPING = 0x2
, LINEAR_X = 0x2 , LINEAR_X = 0x4
, LINEAR_Y = 0x4 , LINEAR_Y = 0x8
, LINEAR_Z = 0x8 , LINEAR_Z = 0x10
, ANGULAR_X = 0x10 , ANGULAR_X = 0x20
, ANGULAR_Y = 0x20 , ANGULAR_Y = 0x30
, ANGULAR_Z = 0x30 , ANGULAR_Z = 0x40
}; };
/*---------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------*/