diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/ModifiedBulletX/ModifiedBulletX/Dynamics/Vehicle/RaycastVehicle.cs | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/libraries/ModifiedBulletX/ModifiedBulletX/Dynamics/Vehicle/RaycastVehicle.cs b/libraries/ModifiedBulletX/ModifiedBulletX/Dynamics/Vehicle/RaycastVehicle.cs deleted file mode 100644 index 4e0e64b..0000000 --- a/libraries/ModifiedBulletX/ModifiedBulletX/Dynamics/Vehicle/RaycastVehicle.cs +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | /* | ||
2 | Bullet for XNA Copyright (c) 2003-2007 Vsevolod Klementjev http://www.codeplex.com/xnadevru | ||
3 | Bullet original C++ version Copyright (c) 2003-2007 Erwin Coumans http://bulletphysics.com | ||
4 | |||
5 | This software is provided 'as-is', without any express or implied | ||
6 | warranty. In no event will the authors be held liable for any damages | ||
7 | arising from the use of this software. | ||
8 | |||
9 | Permission is granted to anyone to use this software for any purpose, | ||
10 | including commercial applications, and to alter it and redistribute it | ||
11 | freely, subject to the following restrictions: | ||
12 | |||
13 | 1. The origin of this software must not be misrepresented; you must not | ||
14 | claim that you wrote the original software. If you use this software | ||
15 | in a product, an acknowledgment in the product documentation would be | ||
16 | appreciated but is not required. | ||
17 | 2. Altered source versions must be plainly marked as such, and must not be | ||
18 | misrepresented as being the original software. | ||
19 | 3. This notice may not be removed or altered from any source distribution. | ||
20 | */ | ||
21 | |||
22 | using System; | ||
23 | using System.Collections.Generic; | ||
24 | using System.Text; | ||
25 | using MonoXnaCompactMaths; | ||
26 | |||
27 | namespace XnaDevRu.BulletX.Dynamics | ||
28 | { | ||
29 | public class RaycastVehicle : TypedConstraint | ||
30 | { | ||
31 | public override void BuildJacobian() | ||
32 | { | ||
33 | throw new Exception("The method or operation is not implemented."); | ||
34 | } | ||
35 | |||
36 | public override void SolveConstraint(float timeStep) | ||
37 | { | ||
38 | throw new Exception("The method or operation is not implemented."); | ||
39 | } | ||
40 | |||
41 | public int getNumWheels() | ||
42 | { | ||
43 | throw new Exception("The method or operation is not implemented."); | ||
44 | } | ||
45 | |||
46 | public WheelInfo getWheelInfo(int v) | ||
47 | { | ||
48 | throw new Exception("The method or operation is not implemented."); | ||
49 | } | ||
50 | |||
51 | public void updateWheelTransform(int v, bool p) | ||
52 | { | ||
53 | throw new Exception("The method or operation is not implemented."); | ||
54 | } | ||
55 | |||
56 | public int getRightAxis() | ||
57 | { | ||
58 | throw new Exception("The method or operation is not implemented."); | ||
59 | } | ||
60 | |||
61 | public void updateVehicle(float timeStep) | ||
62 | { | ||
63 | throw new Exception("The method or operation is not implemented."); | ||
64 | } | ||
65 | } | ||
66 | |||
67 | public class DefaultVehicleRaycaster : IVehicleRaycaster | ||
68 | { | ||
69 | DynamicsWorld _dynamicsWorld; | ||
70 | |||
71 | public DefaultVehicleRaycaster(DynamicsWorld world) | ||
72 | { | ||
73 | _dynamicsWorld = world; | ||
74 | } | ||
75 | |||
76 | public object CastRay(Vector3 from, Vector3 to, out VehicleRaycasterResult result) | ||
77 | { | ||
78 | CollisionWorld.ClosestRayResultCallback rayCallback = new CollisionWorld.ClosestRayResultCallback(from, to); | ||
79 | _dynamicsWorld.RayTest(from, to, rayCallback); | ||
80 | |||
81 | result = new VehicleRaycasterResult(); | ||
82 | |||
83 | if (!rayCallback.HasHit) return 0; | ||
84 | RigidBody body = RigidBody.Upcast(rayCallback.CollisionObject); | ||
85 | if (body == null) return 0; | ||
86 | |||
87 | result.HitPointInWorld = rayCallback.HitPointWorld; | ||
88 | result.HitNormalInWorld = rayCallback.HitNormalWorld; | ||
89 | result.HitNormalInWorld.Normalize(); | ||
90 | result.DistFraction = rayCallback.ClosestHitFraction; | ||
91 | return body; | ||
92 | } | ||
93 | } | ||
94 | } \ No newline at end of file | ||