Refactored Raycasting, Added Layers for Raycasting to C#, Fixed Collision Tag Panel #331
|
@ -1,4 +1,4 @@
|
||||||
Start in Fullscreen: false
|
Start in Fullscreen: false
|
||||||
Starting Scene ID: 97158628
|
Starting Scene ID: 97086054
|
||||||
Window Size: {x: 1920, y: 1080}
|
Window Size: {x: 1920, y: 1080}
|
||||||
Window Title: SHADE Engine
|
Window Title: SHADE Engine
|
|
@ -1,4 +1,4 @@
|
||||||
Start Maximized: true
|
Start Maximized: true
|
||||||
Working Scene ID: 84373000
|
Working Scene ID: 97086054
|
||||||
Window Size: {x: 1920, y: 1013}
|
Window Size: {x: 1920, y: 1013}
|
||||||
Style: 0
|
Style: 0
|
|
@ -20,8 +20,8 @@ Size=400,400
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Inspector]
|
[Window][Inspector]
|
||||||
Pos=1604,48
|
Pos=1434,48
|
||||||
Size=316,941
|
Size=486,941
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000006,0
|
DockId=0x00000006,0
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ DockId=0x0000000B,0
|
||||||
|
|
||||||
[Window][ Viewport]
|
[Window][ Viewport]
|
||||||
Pos=302,48
|
Pos=302,48
|
||||||
Size=1300,836
|
Size=1130,705
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x0000000B,0
|
DockId=0x0000000B,0
|
||||||
|
|
||||||
|
@ -93,14 +93,14 @@ Collapsed=0
|
||||||
DockId=0x0000000A,0
|
DockId=0x0000000A,0
|
||||||
|
|
||||||
[Window][ Asset Browser]
|
[Window][ Asset Browser]
|
||||||
Pos=302,886
|
Pos=302,755
|
||||||
Size=1300,103
|
Size=1130,234
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x0000000C,0
|
DockId=0x0000000C,0
|
||||||
|
|
||||||
[Window][Material Inspector]
|
[Window][Material Inspector]
|
||||||
Pos=1604,48
|
Pos=1434,48
|
||||||
Size=316,941
|
Size=486,941
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
DockId=0x00000006,1
|
DockId=0x00000006,1
|
||||||
|
|
||||||
|
@ -115,14 +115,16 @@ Size=464,144
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Window][Collider Tag Panel]
|
[Window][Collider Tag Panel]
|
||||||
Pos=60,60
|
Pos=302,48
|
||||||
Size=625,744
|
Size=1130,705
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
DockId=0x0000000B,1
|
||||||
|
|
||||||
[Window][Input Bindings Panel]
|
[Window][Input Bindings Panel]
|
||||||
Pos=60,60
|
Pos=1434,48
|
||||||
Size=154,204
|
Size=486,941
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
DockId=0x00000006,2
|
||||||
|
|
||||||
[Window][Save Scene As]
|
[Window][Save Scene As]
|
||||||
Pos=877,444
|
Pos=877,444
|
||||||
|
@ -130,36 +132,36 @@ Size=165,120
|
||||||
Collapsed=0
|
Collapsed=0
|
||||||
|
|
||||||
[Table][0x9D40AE32,17]
|
[Table][0x9D40AE32,17]
|
||||||
Column 0 Weight=1.0000
|
Column 0 Weight=0.9945
|
||||||
Column 1 Weight=1.0000
|
Column 1 Weight=0.9945
|
||||||
Column 2 Weight=1.0000
|
Column 2 Weight=0.9945
|
||||||
Column 3 Weight=1.0000
|
Column 3 Weight=0.9945
|
||||||
Column 4 Weight=1.0000
|
Column 4 Weight=0.9945
|
||||||
Column 5 Weight=1.0000
|
Column 5 Weight=0.9945
|
||||||
Column 6 Weight=1.0000
|
Column 6 Weight=0.9945
|
||||||
Column 7 Weight=1.0000
|
Column 7 Weight=0.9945
|
||||||
Column 8 Weight=1.0000
|
Column 8 Weight=0.9945
|
||||||
Column 9 Weight=1.0000
|
Column 9 Weight=0.9945
|
||||||
Column 10 Weight=1.0000
|
Column 10 Weight=0.9945
|
||||||
Column 11 Weight=1.0000
|
Column 11 Weight=0.9945
|
||||||
Column 12 Weight=1.0000
|
Column 12 Weight=1.0132
|
||||||
Column 13 Weight=1.0000
|
Column 13 Weight=0.8444
|
||||||
Column 14 Weight=1.0000
|
Column 14 Weight=0.9945
|
||||||
Column 15 Weight=1.0000
|
Column 15 Weight=1.2009
|
||||||
Column 16 Weight=1.0000
|
Column 16 Weight=1.0132
|
||||||
|
|
||||||
[Docking][Data]
|
[Docking][Data]
|
||||||
DockSpace ID=0xC5C9B8AB Window=0xBE4044E9 Pos=0,71 Size=1920,941 Split=X
|
DockSpace ID=0xC5C9B8AB Window=0xBE4044E9 Pos=0,71 Size=1920,941 Split=X
|
||||||
DockNode ID=0x00000005 Parent=0xC5C9B8AB SizeRef=1602,1036 Split=X
|
DockNode ID=0x00000005 Parent=0xC5C9B8AB SizeRef=1432,1036 Split=X
|
||||||
DockNode ID=0x00000001 Parent=0x00000005 SizeRef=300,1036 Split=Y Selected=0x1E6EB881
|
DockNode ID=0x00000001 Parent=0x00000005 SizeRef=300,1036 Split=Y Selected=0x1E6EB881
|
||||||
DockNode ID=0x00000003 Parent=0x00000001 SizeRef=225,147 Selected=0x1E6EB881
|
DockNode ID=0x00000003 Parent=0x00000001 SizeRef=225,147 Selected=0x1E6EB881
|
||||||
DockNode ID=0x00000004 Parent=0x00000001 SizeRef=225,863 Selected=0xE096E5AE
|
DockNode ID=0x00000004 Parent=0x00000001 SizeRef=225,863 Selected=0xE096E5AE
|
||||||
DockNode ID=0x00000002 Parent=0x00000005 SizeRef=1300,1036 Split=Y Selected=0xB41284E7
|
DockNode ID=0x00000002 Parent=0x00000005 SizeRef=1130,1036 Split=Y Selected=0xB41284E7
|
||||||
DockNode ID=0x00000007 Parent=0x00000002 SizeRef=1501,672 Split=Y Selected=0xB41284E7
|
DockNode ID=0x00000007 Parent=0x00000002 SizeRef=1501,672 Split=Y Selected=0xB41284E7
|
||||||
DockNode ID=0x00000009 Parent=0x00000007 SizeRef=1501,700 Split=Y Selected=0xB41284E7
|
DockNode ID=0x00000009 Parent=0x00000007 SizeRef=1501,700 Split=Y Selected=0xB41284E7
|
||||||
DockNode ID=0x0000000B Parent=0x00000009 SizeRef=1501,836 CentralNode=1 Selected=0xB41284E7
|
DockNode ID=0x0000000B Parent=0x00000009 SizeRef=1501,705 CentralNode=1 Selected=0xB41284E7
|
||||||
DockNode ID=0x0000000C Parent=0x00000009 SizeRef=1501,103 Selected=0xB128252A
|
DockNode ID=0x0000000C Parent=0x00000009 SizeRef=1501,234 Selected=0xB128252A
|
||||||
DockNode ID=0x0000000A Parent=0x00000007 SizeRef=1501,310 Selected=0xD446F7B6
|
DockNode ID=0x0000000A Parent=0x00000007 SizeRef=1501,310 Selected=0xD446F7B6
|
||||||
DockNode ID=0x00000008 Parent=0x00000002 SizeRef=1501,338 Selected=0xD9F31532
|
DockNode ID=0x00000008 Parent=0x00000002 SizeRef=1501,338 Selected=0xD9F31532
|
||||||
DockNode ID=0x00000006 Parent=0xC5C9B8AB SizeRef=316,1036 Selected=0xE7039252
|
DockNode ID=0x00000006 Parent=0xC5C9B8AB SizeRef=486,1036 Selected=0xE7039252
|
||||||
|
|
||||||
|
|
|
@ -4,15 +4,15 @@
|
||||||
NumberOfChildren: 0
|
NumberOfChildren: 0
|
||||||
Components:
|
Components:
|
||||||
Transform Component:
|
Transform Component:
|
||||||
Translate: {x: 0, y: 7, z: -0.5}
|
Translate: {x: 0, y: 7, z: 0}
|
||||||
Rotate: {x: 0, y: 0, z: 0.785398185}
|
Rotate: {x: 0, y: 0, z: 0}
|
||||||
Scale: {x: 0.999999344, y: 0.999999821, z: 0.999999523}
|
Scale: {x: 0.999999344, y: 0.999999821, z: 0.999999523}
|
||||||
IsActive: true
|
IsActive: true
|
||||||
RigidBody Component:
|
RigidBody Component:
|
||||||
Type: Dynamic
|
Type: Dynamic
|
||||||
Drag: 0.00999999978
|
Drag: 0.00999999978
|
||||||
Angular Drag: 0.100000001
|
Angular Drag: 0.100000001
|
||||||
Use Gravity: true
|
Use Gravity: false
|
||||||
Interpolate: true
|
Interpolate: true
|
||||||
Sleeping Enabled: true
|
Sleeping Enabled: true
|
||||||
Freeze Position X: false
|
Freeze Position X: false
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
- EID: 0
|
|
||||||
Name: Default
|
|
||||||
IsActive: true
|
|
||||||
NumberOfChildren: 0
|
|
||||||
Components:
|
|
||||||
Camera Component:
|
|
||||||
Position: {x: 0, y: 0, z: 0}
|
|
||||||
Pitch: 0
|
|
||||||
Yaw: 0
|
|
||||||
Roll: 0
|
|
||||||
Width: 1920
|
|
||||||
Height: 1080
|
|
||||||
Near: 0.00999999978
|
|
||||||
Far: 10000
|
|
||||||
Perspective: true
|
|
||||||
IsActive: true
|
|
||||||
Scripts: ~
|
|
||||||
- EID: 1
|
|
||||||
Name: Default
|
|
||||||
IsActive: true
|
|
||||||
NumberOfChildren: 0
|
|
||||||
Components:
|
|
||||||
Transform Component:
|
|
||||||
Translate: {x: 0, y: 0, z: 0}
|
|
||||||
Rotate: {x: 0, y: 0, z: 0}
|
|
||||||
Scale: {x: 1, y: 1, z: 1}
|
|
||||||
IsActive: true
|
|
||||||
RigidBody Component:
|
|
||||||
Type: Dynamic
|
|
||||||
Drag: 0.00999999978
|
|
||||||
Angular Drag: 0.100000001
|
|
||||||
Use Gravity: false
|
|
||||||
Interpolate: true
|
|
||||||
Sleeping Enabled: true
|
|
||||||
Freeze Position X: false
|
|
||||||
Freeze Position Y: false
|
|
||||||
Freeze Position Z: false
|
|
||||||
Freeze Rotation X: false
|
|
||||||
Freeze Rotation Y: false
|
|
||||||
Freeze Rotation Z: false
|
|
||||||
IsActive: true
|
|
||||||
Scripts: ~
|
|
|
@ -1,3 +0,0 @@
|
||||||
Name: Test
|
|
||||||
ID: 97979840
|
|
||||||
Type: 5
|
|
|
@ -1,100 +0,0 @@
|
||||||
- EID: 0
|
|
||||||
Name: Default
|
|
||||||
IsActive: true
|
|
||||||
NumberOfChildren: 0
|
|
||||||
Components:
|
|
||||||
Transform Component:
|
|
||||||
Translate: {x: 2, y: 2, z: 0}
|
|
||||||
Rotate: {x: -0, y: 0, z: -0}
|
|
||||||
Scale: {x: 1, y: 1, z: 1}
|
|
||||||
IsActive: true
|
|
||||||
RigidBody Component:
|
|
||||||
Type: Dynamic
|
|
||||||
Drag: 0.00999999978
|
|
||||||
Angular Drag: 0.100000001
|
|
||||||
Use Gravity: true
|
|
||||||
Interpolate: true
|
|
||||||
Sleeping Enabled: false
|
|
||||||
Freeze Position X: false
|
|
||||||
Freeze Position Y: false
|
|
||||||
Freeze Position Z: false
|
|
||||||
Freeze Rotation X: false
|
|
||||||
Freeze Rotation Y: false
|
|
||||||
Freeze Rotation Z: false
|
|
||||||
IsActive: true
|
|
||||||
Collider Component:
|
|
||||||
Colliders:
|
|
||||||
- Is Trigger: false
|
|
||||||
Collision Tag: 1
|
|
||||||
Type: Sphere
|
|
||||||
Radius: 1
|
|
||||||
Friction: 0.400000006
|
|
||||||
Bounciness: 0
|
|
||||||
Density: 1
|
|
||||||
Position Offset: {x: 0, y: 0, z: 0}
|
|
||||||
Rotation Offset: {x: 0, y: 0, z: 0}
|
|
||||||
IsActive: true
|
|
||||||
Scripts: ~
|
|
||||||
- EID: 1
|
|
||||||
Name: Default
|
|
||||||
IsActive: true
|
|
||||||
NumberOfChildren: 0
|
|
||||||
Components:
|
|
||||||
Camera Component:
|
|
||||||
Position: {x: 0, y: 0, z: 5}
|
|
||||||
Pitch: 0
|
|
||||||
Yaw: 0
|
|
||||||
Roll: 0
|
|
||||||
Width: 1920
|
|
||||||
Height: 1080
|
|
||||||
Near: 0.00999999978
|
|
||||||
Far: 10000
|
|
||||||
Perspective: true
|
|
||||||
IsActive: true
|
|
||||||
Scripts: ~
|
|
||||||
- EID: 2
|
|
||||||
Name: Default
|
|
||||||
IsActive: true
|
|
||||||
NumberOfChildren: 0
|
|
||||||
Components:
|
|
||||||
Transform Component:
|
|
||||||
Translate: {x: 0, y: 0, z: 0}
|
|
||||||
Rotate: {x: -0, y: 0, z: -0}
|
|
||||||
Scale: {x: 1, y: 1, z: 1}
|
|
||||||
IsActive: true
|
|
||||||
RigidBody Component:
|
|
||||||
Type: Dynamic
|
|
||||||
Drag: 0.00999999978
|
|
||||||
Angular Drag: 0.100000001
|
|
||||||
Use Gravity: false
|
|
||||||
Interpolate: true
|
|
||||||
Sleeping Enabled: false
|
|
||||||
Freeze Position X: true
|
|
||||||
Freeze Position Y: true
|
|
||||||
Freeze Position Z: true
|
|
||||||
Freeze Rotation X: false
|
|
||||||
Freeze Rotation Y: false
|
|
||||||
Freeze Rotation Z: false
|
|
||||||
IsActive: true
|
|
||||||
Collider Component:
|
|
||||||
Colliders:
|
|
||||||
- Is Trigger: false
|
|
||||||
Collision Tag: 3
|
|
||||||
Type: Sphere
|
|
||||||
Radius: 1
|
|
||||||
Friction: 0.400000006
|
|
||||||
Bounciness: 0
|
|
||||||
Density: 1
|
|
||||||
Position Offset: {x: 0, y: 0, z: 0}
|
|
||||||
Rotation Offset: {x: 0, y: 0, z: 0}
|
|
||||||
- Is Trigger: false
|
|
||||||
Collision Tag: 2
|
|
||||||
Type: Box
|
|
||||||
Half Extents: {x: 1, y: 1, z: 1}
|
|
||||||
Friction: 0.400000006
|
|
||||||
Bounciness: 0
|
|
||||||
Density: 1
|
|
||||||
Position Offset: {x: 2, y: 0, z: 0}
|
|
||||||
Rotation Offset: {x: 0, y: 0, z: 0}
|
|
||||||
IsActive: true
|
|
||||||
Scripts: ~
|
|
|
@ -1,3 +0,0 @@
|
||||||
Name: x
|
|
||||||
ID: 84373000
|
|
||||||
Type: 5
|
|
|
@ -159,7 +159,7 @@ public partial class LeafSearch : BehaviourTreeNode
|
||||||
//Since transform position is often the raccoon's base and the ray needs to hit somewhere higher to be more reliable
|
//Since transform position is often the raccoon's base and the ray needs to hit somewhere higher to be more reliable
|
||||||
Vector3 rayDestination = plrT.GlobalPosition + plrT.GlobalScale * playerCollider.PositionOffset;
|
Vector3 rayDestination = plrT.GlobalPosition + plrT.GlobalScale * playerCollider.PositionOffset;
|
||||||
Ray sightRay = new Ray(eyePosition, rayDestination - eyePosition);
|
Ray sightRay = new Ray(eyePosition, rayDestination - eyePosition);
|
||||||
RaycastHit sightRayHit = Physics.Raycast(sightRay, false)[0];
|
RaycastHit sightRayHit = Physics.Raycast(sightRay, false, (ushort)65535)[0];
|
||||||
//As of November 2022, RaycastHit contains only the FIRST object hit by
|
//As of November 2022, RaycastHit contains only the FIRST object hit by
|
||||||
//the ray in the Other GameObject data member
|
//the ray in the Other GameObject data member
|
||||||
//Diren may likely add ALL objects hit by the ray over December
|
//Diren may likely add ALL objects hit by the ray over December
|
||||||
|
|
|
@ -204,9 +204,9 @@ public class PickAndThrow : Script
|
||||||
Vector3 playerRayPos = pc.tranform.GlobalPosition;
|
Vector3 playerRayPos = pc.tranform.GlobalPosition;
|
||||||
playerRayPos.y += 0.05f;
|
playerRayPos.y += 0.05f;
|
||||||
dirNor.Normalise();
|
dirNor.Normalise();
|
||||||
List<RaycastHit> rayList1 = Physics.Raycast(new Ray(playerRayPos, Vector3.RotateY(dirNor, SHADE.Math.DegreesToRadians(22.5f))), rayDistance, false);
|
List<RaycastHit> rayList1 = Physics.Raycast(new Ray(playerRayPos, Vector3.RotateY(dirNor, SHADE.Math.DegreesToRadians(22.5f))), rayDistance, false, (ushort)65535);
|
||||||
List<RaycastHit> rayList2 = Physics.Raycast(new Ray(playerRayPos, Vector3.RotateY(dirNor, SHADE.Math.DegreesToRadians(-22.5f))), rayDistance, false);
|
List<RaycastHit> rayList2 = Physics.Raycast(new Ray(playerRayPos, Vector3.RotateY(dirNor, SHADE.Math.DegreesToRadians(-22.5f))), rayDistance, false, (ushort)65535);
|
||||||
List<RaycastHit> rayList3 = Physics.Raycast(new Ray(playerRayPos, dirNor), rayDistance * 0.75f, false);
|
List<RaycastHit> rayList3 = Physics.Raycast(new Ray(playerRayPos, dirNor), rayDistance * 0.75f, false, (ushort)65535);
|
||||||
|
|
||||||
if (rayList1.Count > 0 && rayList2.Count > 0 && rayList3.Count > 0)
|
if (rayList1.Count > 0 && rayList2.Count > 0 && rayList3.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class PhysicsTestObj : Script
|
||||||
{
|
{
|
||||||
Ray colliderRay = new Ray();
|
Ray colliderRay = new Ray();
|
||||||
colliderRay.Direction = Vector3.Right;
|
colliderRay.Direction = Vector3.Right;
|
||||||
Physics.ColliderRaycast(collider.Owner, colliderRay, false);
|
Physics.ColliderRaycast(collider.Owner, colliderRay, false, 8);
|
||||||
|
|
||||||
for (int i = 0; i < 6; ++i)
|
for (int i = 0; i < 6; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,6 +65,18 @@ namespace SHADE
|
||||||
if (!physicsSystem)
|
if (!physicsSystem)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (DRAW_RAYCASTS)
|
||||||
|
{
|
||||||
|
const SHColour& RAY_COLOUR = physicsDebugDrawSystem->DEBUG_DRAW_COLOURS[SHUtilities::ConvertEnum(Colours::RAYCAST)];
|
||||||
|
|
||||||
|
const auto& RAYS = physicsSystem->raycastHits;
|
||||||
|
for (const auto& hit : RAYS)
|
||||||
|
debugDrawSystem->DrawLine(hit.start, hit.end, RAY_COLOUR, true);
|
||||||
|
|
||||||
|
// Clear rays for the physics system
|
||||||
|
physicsSystem->raycastHits.clear();
|
||||||
|
}
|
||||||
|
|
||||||
rp3d::DebugRenderer* rp3dRenderer = nullptr;
|
rp3d::DebugRenderer* rp3dRenderer = nullptr;
|
||||||
if (physicsSystem->worldState.world)
|
if (physicsSystem->worldState.world)
|
||||||
rp3dRenderer = &physicsSystem->worldState.world->getDebugRenderer();
|
rp3dRenderer = &physicsSystem->worldState.world->getDebugRenderer();
|
||||||
|
@ -96,18 +108,6 @@ namespace SHADE
|
||||||
for (int i = 0; i < NUM_LINES; ++i)
|
for (int i = 0; i < NUM_LINES; ++i)
|
||||||
debugDrawSystem->DrawLine(LINE_ARRAY[i].point1, LINE_ARRAY[i].point2, CONTACT_COLOUR, true);
|
debugDrawSystem->DrawLine(LINE_ARRAY[i].point1, LINE_ARRAY[i].point2, CONTACT_COLOUR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DRAW_RAYCASTS)
|
|
||||||
{
|
|
||||||
const SHColour& RAY_COLOUR = physicsDebugDrawSystem->DEBUG_DRAW_COLOURS[SHUtilities::ConvertEnum(Colours::RAYCAST)];
|
|
||||||
|
|
||||||
const auto& RAYS = physicsSystem->raycastHits;
|
|
||||||
for (const auto& hit : RAYS)
|
|
||||||
debugDrawSystem->DrawLine(hit.start, hit.end, RAY_COLOUR, true);
|
|
||||||
|
|
||||||
// Clear rays for the physics system
|
|
||||||
physicsSystem->raycastHits.clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace SHADE
|
} // namespace SHADE
|
|
@ -45,7 +45,7 @@ namespace SHADE
|
||||||
/* Raycast Function Member Definitions */
|
/* Raycast Function Member Definitions */
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
List<RaycastHit>^ Physics::Raycast(Ray ray, bool continuous)
|
List<RaycastHit>^ Physics::Raycast(Ray ray, bool continuous, unsigned short layer)
|
||||||
{
|
{
|
||||||
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ namespace SHADE
|
||||||
SHPhysicsSystemInterface::RaycastInfo raycastInfo;
|
SHPhysicsSystemInterface::RaycastInfo raycastInfo;
|
||||||
raycastInfo.ray = Convert::ToNative(ray);
|
raycastInfo.ray = Convert::ToNative(ray);
|
||||||
raycastInfo.continuous = continuous;
|
raycastInfo.continuous = continuous;
|
||||||
|
raycastInfo.layers = layer;
|
||||||
|
|
||||||
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
||||||
if (!NATIVE_RESULTS.empty())
|
if (!NATIVE_RESULTS.empty())
|
||||||
|
@ -64,7 +65,7 @@ namespace SHADE
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RaycastHit>^ Physics::Raycast(Ray ray, float distance, bool continuous)
|
List<RaycastHit>^ Physics::Raycast(Ray ray, float distance, bool continuous, unsigned short layer)
|
||||||
{
|
{
|
||||||
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
||||||
|
|
||||||
|
@ -73,6 +74,7 @@ namespace SHADE
|
||||||
raycastInfo.ray = Convert::ToNative(ray);
|
raycastInfo.ray = Convert::ToNative(ray);
|
||||||
raycastInfo.distance = distance;
|
raycastInfo.distance = distance;
|
||||||
raycastInfo.continuous = continuous;
|
raycastInfo.continuous = continuous;
|
||||||
|
raycastInfo.layers = layer;
|
||||||
|
|
||||||
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
||||||
if (!NATIVE_RESULTS.empty())
|
if (!NATIVE_RESULTS.empty())
|
||||||
|
@ -84,7 +86,7 @@ namespace SHADE
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RaycastHit>^ Physics::Linecast(Vector3 start, Vector3 end, bool continuous)
|
List<RaycastHit>^ Physics::Linecast(Vector3 start, Vector3 end, bool continuous, unsigned short layer)
|
||||||
{
|
{
|
||||||
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
||||||
|
|
||||||
|
@ -97,6 +99,7 @@ namespace SHADE
|
||||||
raycastInfo.ray = Convert::ToNative(CLI_RAY);
|
raycastInfo.ray = Convert::ToNative(CLI_RAY);
|
||||||
raycastInfo.distance = (end - start).GetMagnitude();
|
raycastInfo.distance = (end - start).GetMagnitude();
|
||||||
raycastInfo.continuous = continuous;
|
raycastInfo.continuous = continuous;
|
||||||
|
raycastInfo.layers = layer;
|
||||||
|
|
||||||
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
||||||
if (!NATIVE_RESULTS.empty())
|
if (!NATIVE_RESULTS.empty())
|
||||||
|
@ -108,7 +111,7 @@ namespace SHADE
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RaycastHit>^ Physics::ColliderRaycast(GameObject object, Ray ray, bool continuous)
|
List<RaycastHit>^ Physics::ColliderRaycast(GameObject object, Ray ray, bool continuous, unsigned short layer)
|
||||||
{
|
{
|
||||||
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
||||||
|
|
||||||
|
@ -123,6 +126,7 @@ namespace SHADE
|
||||||
SHPhysicsSystemInterface::RaycastInfo raycastInfo;
|
SHPhysicsSystemInterface::RaycastInfo raycastInfo;
|
||||||
raycastInfo.ray = Convert::ToNative(ray);
|
raycastInfo.ray = Convert::ToNative(ray);
|
||||||
raycastInfo.continuous = continuous;
|
raycastInfo.continuous = continuous;
|
||||||
|
raycastInfo.layers = layer;
|
||||||
raycastInfo.SetColliderID(object.EntityId);
|
raycastInfo.SetColliderID(object.EntityId);
|
||||||
|
|
||||||
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
||||||
|
@ -135,7 +139,7 @@ namespace SHADE
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RaycastHit>^ Physics::ColliderRaycast(GameObject object, Ray ray, float distance, bool continuous)
|
List<RaycastHit>^ Physics::ColliderRaycast(GameObject object, Ray ray, float distance, bool continuous, unsigned short layer)
|
||||||
{
|
{
|
||||||
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
||||||
|
|
||||||
|
@ -151,6 +155,7 @@ namespace SHADE
|
||||||
raycastInfo.ray = Convert::ToNative(ray);
|
raycastInfo.ray = Convert::ToNative(ray);
|
||||||
raycastInfo.distance = distance;
|
raycastInfo.distance = distance;
|
||||||
raycastInfo.continuous = continuous;
|
raycastInfo.continuous = continuous;
|
||||||
|
raycastInfo.layers = layer;
|
||||||
raycastInfo.SetColliderID(object.EntityId);
|
raycastInfo.SetColliderID(object.EntityId);
|
||||||
|
|
||||||
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
||||||
|
@ -163,7 +168,7 @@ namespace SHADE
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RaycastHit>^ Physics::ColliderRaycast(GameObject object, int shapeIndex, Ray ray, bool continuous)
|
List<RaycastHit>^ Physics::ColliderRaycast(GameObject object, int shapeIndex, Ray ray, bool continuous, unsigned short layer)
|
||||||
{
|
{
|
||||||
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
||||||
|
|
||||||
|
@ -185,6 +190,7 @@ namespace SHADE
|
||||||
SHPhysicsSystemInterface::RaycastInfo raycastInfo;
|
SHPhysicsSystemInterface::RaycastInfo raycastInfo;
|
||||||
raycastInfo.ray = Convert::ToNative(ray);
|
raycastInfo.ray = Convert::ToNative(ray);
|
||||||
raycastInfo.continuous = continuous;
|
raycastInfo.continuous = continuous;
|
||||||
|
raycastInfo.layers = layer;
|
||||||
raycastInfo.SetColliderID(object.EntityId);
|
raycastInfo.SetColliderID(object.EntityId);
|
||||||
|
|
||||||
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
||||||
|
@ -197,7 +203,7 @@ namespace SHADE
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RaycastHit>^ Physics::ColliderRaycast(GameObject object, int shapeIndex, Ray ray, float distance, bool continuous)
|
List<RaycastHit>^ Physics::ColliderRaycast(GameObject object, int shapeIndex, Ray ray, float distance, bool continuous, unsigned short layer)
|
||||||
{
|
{
|
||||||
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
||||||
|
|
||||||
|
@ -220,6 +226,7 @@ namespace SHADE
|
||||||
raycastInfo.ray = Convert::ToNative(ray);
|
raycastInfo.ray = Convert::ToNative(ray);
|
||||||
raycastInfo.continuous = continuous;
|
raycastInfo.continuous = continuous;
|
||||||
raycastInfo.distance = distance;
|
raycastInfo.distance = distance;
|
||||||
|
raycastInfo.layers = layer;
|
||||||
raycastInfo.SetColliderID(object.EntityId);
|
raycastInfo.SetColliderID(object.EntityId);
|
||||||
|
|
||||||
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
||||||
|
@ -232,7 +239,7 @@ namespace SHADE
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RaycastHit>^ Physics::ColliderLineCast(GameObject object, Vector3 start, Vector3 end, bool continuous)
|
List<RaycastHit>^ Physics::ColliderLineCast(GameObject object, Vector3 start, Vector3 end, bool continuous, unsigned short layer)
|
||||||
{
|
{
|
||||||
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
||||||
|
|
||||||
|
@ -252,6 +259,7 @@ namespace SHADE
|
||||||
raycastInfo.ray = Convert::ToNative(CLI_RAY);
|
raycastInfo.ray = Convert::ToNative(CLI_RAY);
|
||||||
raycastInfo.distance = (end - start).GetMagnitude();
|
raycastInfo.distance = (end - start).GetMagnitude();
|
||||||
raycastInfo.continuous = continuous;
|
raycastInfo.continuous = continuous;
|
||||||
|
raycastInfo.layers = layer;
|
||||||
raycastInfo.SetColliderID(object.EntityId);
|
raycastInfo.SetColliderID(object.EntityId);
|
||||||
|
|
||||||
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
||||||
|
@ -264,7 +272,7 @@ namespace SHADE
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RaycastHit>^ Physics::ColliderLineCast(GameObject object, int shapeIndex, Vector3 start, Vector3 end, bool continuous)
|
List<RaycastHit>^ Physics::ColliderLineCast(GameObject object, int shapeIndex, Vector3 start, Vector3 end, bool continuous, unsigned short layer)
|
||||||
{
|
{
|
||||||
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
List<RaycastHit>^ results = gcnew List<RaycastHit>();
|
||||||
|
|
||||||
|
@ -291,6 +299,7 @@ namespace SHADE
|
||||||
raycastInfo.ray = Convert::ToNative(CLI_RAY);
|
raycastInfo.ray = Convert::ToNative(CLI_RAY);
|
||||||
raycastInfo.continuous = continuous;
|
raycastInfo.continuous = continuous;
|
||||||
raycastInfo.distance = (end - start).GetMagnitude();
|
raycastInfo.distance = (end - start).GetMagnitude();
|
||||||
|
raycastInfo.layers = layer;
|
||||||
raycastInfo.SetColliderID(object.EntityId);
|
raycastInfo.SetColliderID(object.EntityId);
|
||||||
|
|
||||||
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
const auto& NATIVE_RESULTS = SHPhysicsSystemInterface::Raycast(raycastInfo);
|
||||||
|
|
|
@ -47,10 +47,13 @@ namespace SHADE
|
||||||
/// <param name="continuous">
|
/// <param name="continuous">
|
||||||
/// Whether or not the raycast should stop at the first object hit.
|
/// Whether or not the raycast should stop at the first object hit.
|
||||||
/// </param>
|
/// </param>
|
||||||
|
/// <param name="layer">
|
||||||
|
/// The layers to cast the ray on.
|
||||||
|
/// </param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
static System::Collections::Generic::List<RaycastHit>^ Raycast (Ray ray, bool continuous);
|
static System::Collections::Generic::List<RaycastHit>^ Raycast (Ray ray, bool continuous, unsigned short layer);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Casts a ray for a given distance into the world.
|
/// Casts a ray for a given distance into the world.
|
||||||
|
@ -63,7 +66,7 @@ namespace SHADE
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
static System::Collections::Generic::List<RaycastHit>^ Raycast (Ray ray, float distance, bool continuous);
|
static System::Collections::Generic::List<RaycastHit>^ Raycast (Ray ray, float distance, bool continuous, unsigned short layer);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Casts a bounded ray into the world.
|
/// Casts a bounded ray into the world.
|
||||||
|
@ -76,7 +79,7 @@ namespace SHADE
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
static System::Collections::Generic::List<RaycastHit>^ Linecast (Vector3 start, Vector3 end, bool continuous);
|
static System::Collections::Generic::List<RaycastHit>^ Linecast (Vector3 start, Vector3 end, bool continuous, unsigned short layer);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Casts an infinite ray w.r.t a GameObject.
|
/// Casts an infinite ray w.r.t a GameObject.
|
||||||
|
@ -92,7 +95,7 @@ namespace SHADE
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
static System::Collections::Generic::List<RaycastHit>^ ColliderRaycast (GameObject object, Ray ray, bool continuous);
|
static System::Collections::Generic::List<RaycastHit>^ ColliderRaycast (GameObject object, Ray ray, bool continuous, unsigned short layer);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Casts a ray for a given distance w.r.t a GameObject.
|
/// Casts a ray for a given distance w.r.t a GameObject.
|
||||||
|
@ -109,7 +112,7 @@ namespace SHADE
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
static System::Collections::Generic::List<RaycastHit>^ ColliderRaycast (GameObject object, Ray ray, float distance, bool continuous);
|
static System::Collections::Generic::List<RaycastHit>^ ColliderRaycast (GameObject object, Ray ray, float distance, bool continuous, unsigned short layer);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Casts an infinite ray w.r.t a specific collider on a GameObject.
|
/// Casts an infinite ray w.r.t a specific collider on a GameObject.
|
||||||
|
@ -126,7 +129,7 @@ namespace SHADE
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
static System::Collections::Generic::List<RaycastHit>^ ColliderRaycast (GameObject object, int shapeIndex, Ray ray, bool continuous);
|
static System::Collections::Generic::List<RaycastHit>^ ColliderRaycast (GameObject object, int shapeIndex, Ray ray, bool continuous, unsigned short layer);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Casts a ray for a given distance w.r.t a specific collider on a GameObject.
|
/// Casts a ray for a given distance w.r.t a specific collider on a GameObject.
|
||||||
|
@ -144,7 +147,7 @@ namespace SHADE
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
static System::Collections::Generic::List<RaycastHit>^ ColliderRaycast (GameObject object, int shapeIndex, Ray ray, float distance, bool continuous);
|
static System::Collections::Generic::List<RaycastHit>^ ColliderRaycast (GameObject object, int shapeIndex, Ray ray, float distance, bool continuous, unsigned short layer);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Casts a bounded ray w.r.t a GameObject.
|
/// Casts a bounded ray w.r.t a GameObject.
|
||||||
|
@ -160,7 +163,7 @@ namespace SHADE
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
/// The results of the raycast. If nothing was hit, an empty list is returned.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
static System::Collections::Generic::List<RaycastHit>^ ColliderLineCast (GameObject object, Vector3 start, Vector3 end, bool continuous);
|
static System::Collections::Generic::List<RaycastHit>^ ColliderLineCast (GameObject object, Vector3 start, Vector3 end, bool continuous, unsigned short layer);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Casts a bounded ray w.r.t a specific collider on a GameObject.
|
/// Casts a bounded ray w.r.t a specific collider on a GameObject.
|
||||||
|
@ -176,7 +179,7 @@ namespace SHADE
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The results of the raycast. If nothing was hit, an empty list is returned./// </returns>
|
/// The results of the raycast. If nothing was hit, an empty list is returned./// </returns>
|
||||||
static System::Collections::Generic::List<RaycastHit>^ ColliderLineCast (GameObject object, int shapeIndex, Vector3 start, Vector3 end, bool continuous);
|
static System::Collections::Generic::List<RaycastHit>^ ColliderLineCast (GameObject object, int shapeIndex, Vector3 start, Vector3 end, bool continuous, unsigned short layer);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*---------------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in New Issue