Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
|
03-01-2005 18:05
I have a ball that moves (thru plain old physics) down a trajectory but could land in one of 9 slots, i need a way to be notified the slot it fell in. I played a bit with the at_target event but it didnt seem to do anything  Any ideas?
|
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
|
03-01-2005 18:24
Ranked easiest to hardest:
1) llVolumeDetect objects in each slot 2) Know all nine regions. If llGetPos is between these points on X/Y/Z, you're here. 3) - llSensor on the slot board - Compare where you are to where the center is with llDetectedPos/llDetectedRot and local rotations (check the wiki) - If you've stopped in this threshhold, you're in this slot
_____________________
---
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
03-01-2005 18:25
Sounds like Plinko... if prims aren't a concern, use 9 prims as collision detectors that only detect a collision with the ball. When a collision is detected, the slot number is sent to the CPU.
If prims are pricey, you could do math. I assume the 9 slots are separated by 10 dividers. When the machine is placed into the world (or it's pos/rot is changed) the machine collectes location data from the slot dividers. When the ball settles into a slot, it gets it's location, then compares that location with the known locations of dividers... it that location is greater than divider#0, but less than divider#1... the ball is in slot 1. However, greater than divider#6, less than divider#7 means slot 7.
Of course, you'd have to detect the rotation to detect if the calculations should be reversed.
|
Synergy Belvedere
Prim Reaper
Join date: 7 Jul 2004
Posts: 253
|
03-01-2005 19:50
I think VolumeDetect may be a good answer here, thanks folks! 
|