diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs b/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs index 816189f..a288048 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSApiTemplate.cs | |||
@@ -121,6 +121,14 @@ public struct SweepHit | |||
121 | public float Fraction; | 121 | public float Fraction; |
122 | public Vector3 Normal; | 122 | public Vector3 Normal; |
123 | public Vector3 Point; | 123 | public Vector3 Point; |
124 | |||
125 | public bool hasHit() | ||
126 | { | ||
127 | float sum = Fraction | ||
128 | + Normal.X + Normal.Y + Normal.Z | ||
129 | + Point.X + Point.Y + Point.Z; | ||
130 | return (sum != 0) || (ID != 0); | ||
131 | } | ||
124 | } | 132 | } |
125 | [StructLayout(LayoutKind.Sequential)] | 133 | [StructLayout(LayoutKind.Sequential)] |
126 | public struct RaycastHit | 134 | public struct RaycastHit |
@@ -128,6 +136,13 @@ public struct RaycastHit | |||
128 | public UInt32 ID; | 136 | public UInt32 ID; |
129 | public float Fraction; | 137 | public float Fraction; |
130 | public Vector3 Normal; | 138 | public Vector3 Normal; |
139 | public Vector3 Point; | ||
140 | |||
141 | public bool hasHit() | ||
142 | { | ||
143 | float sum = Normal.X + Normal.Y + Normal.Z + Point.X + Point.Y + Point.Z; | ||
144 | return (sum != 0); | ||
145 | } | ||
131 | } | 146 | } |
132 | [StructLayout(LayoutKind.Sequential)] | 147 | [StructLayout(LayoutKind.Sequential)] |
133 | public struct CollisionDesc | 148 | public struct CollisionDesc |
@@ -742,6 +757,12 @@ public abstract void SetMargin(BulletShape shape, float val); | |||
742 | public abstract float GetMargin(BulletShape shape); | 757 | public abstract float GetMargin(BulletShape shape); |
743 | 758 | ||
744 | // ===================================================================================== | 759 | // ===================================================================================== |
760 | // Raycast | ||
761 | public abstract SweepHit ConvexSweepTest2(BulletWorld world, BulletBody obj, Vector3 from, Vector3 to, float margin); | ||
762 | |||
763 | public abstract RaycastHit RayTest2(BulletWorld world, Vector3 from, Vector3 to, uint filterGroup, uint filterMask); | ||
764 | |||
765 | // ===================================================================================== | ||
745 | // Debugging | 766 | // Debugging |
746 | public virtual void DumpRigidBody(BulletWorld sim, BulletBody collisionObject) { } | 767 | public virtual void DumpRigidBody(BulletWorld sim, BulletBody collisionObject) { } |
747 | 768 | ||