diff options
author | Justin Clark-Casey (justincc) | 2011-07-12 22:13:15 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-07-12 22:13:15 +0100 |
commit | 3e456163dd284fa04ab17465041a1a27f7b632b9 (patch) | |
tree | baaa8a470f4afa7637e8919d41e161ec4215ce21 /OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |
parent | temporarily fix the build break with building the OdePlugin tests assembly. (diff) | |
download | opensim-SC-3e456163dd284fa04ab17465041a1a27f7b632b9.zip opensim-SC-3e456163dd284fa04ab17465041a1a27f7b632b9.tar.gz opensim-SC-3e456163dd284fa04ab17465041a1a27f7b632b9.tar.bz2 opensim-SC-3e456163dd284fa04ab17465041a1a27f7b632b9.tar.xz |
Port implementation of llCastRay() from Aurora.
I haven't been able to test this since the viewer won't parse the llCastRay() function. Maybe some activation cap is missing. Could wait until it is activated by default in the viewer.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/OdeScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 7b8a80c..ba8cba4 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |||
@@ -3736,6 +3736,34 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); | |||
3736 | } | 3736 | } |
3737 | } | 3737 | } |
3738 | 3738 | ||
3739 | public override void RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod) | ||
3740 | { | ||
3741 | if (retMethod != null) | ||
3742 | { | ||
3743 | m_rayCastManager.QueueRequest(position, direction, length, Count, retMethod); | ||
3744 | } | ||
3745 | } | ||
3746 | |||
3747 | public override List<ContactResult> RaycastWorld(Vector3 position, Vector3 direction, float length, int Count) | ||
3748 | { | ||
3749 | ContactResult[] ourResults = null; | ||
3750 | RayCallback retMethod = delegate(List<ContactResult> results) | ||
3751 | { | ||
3752 | ourResults = new ContactResult[results.Count]; | ||
3753 | results.CopyTo(ourResults, 0); | ||
3754 | }; | ||
3755 | int waitTime = 0; | ||
3756 | m_rayCastManager.QueueRequest(position, direction, length, Count, retMethod); | ||
3757 | while (ourResults == null && waitTime < 1000) | ||
3758 | { | ||
3759 | Thread.Sleep(1); | ||
3760 | waitTime++; | ||
3761 | } | ||
3762 | if (ourResults == null) | ||
3763 | return new List<ContactResult> (); | ||
3764 | return new List<ContactResult>(ourResults); | ||
3765 | } | ||
3766 | |||
3739 | #if USE_DRAWSTUFF | 3767 | #if USE_DRAWSTUFF |
3740 | // Keyboard callback | 3768 | // Keyboard callback |
3741 | public void command(int cmd) | 3769 | public void command(int cmd) |