|
Cate Baker
Registered User
Join date: 10 Nov 2005
Posts: 5
|
07-21-2006 07:50
Although the wiki does not say so, do one or both prims involved in a collision have to be physical. I was using: collision(integer num_detected) { llSay(0, llDetectedName(0) + " is currently colliding with me!"  ; } in one prim and a loop of llSetPos() to move the other prim through the first, but no collison was reported. The prims were not phantoms but also where not physical
|
|
Ginge Reymont
Registered User
Join date: 10 Oct 2005
Posts: 190
|
07-21-2006 07:51
I think one has to be physical to activate the collision..
|
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
07-21-2006 09:16
Ginge is right, it's one of the things that being physical lets you do.
Avies hit prims because the avies are physical. Non-physical prims just sit there and don't move - they teleport and that can be made to mimic movement, but in terms of the real world things don't act like that. If you edit a prim and change it's location from <128, 128, 80> to <100, 100, 100> it doesn't travel through the intervening space, it vanishes from 128, 128, 80 and appears at 100, 100, 100 (ok in steps but still not colliding with anything, just bang new position). If you use the non-physical movement calls (llSetPos etc.) the steps etc. will be different, but it will still not move, it will simply jump a few times (5 in fact) to the new position without going through the intervening spaces. Thus, no collisions, because no actual movement so it can't hit anything.
Physical prims can hit non-physical ones btw, and trigger collision events. Make a sphere over your floor, make it physical, let it drop, watch it roll...
|
|
Gearsawe Stonecutter
Over there
Join date: 14 Sep 2005
Posts: 614
|
07-21-2006 09:40
So yes the one moving must be set to phyical. http://secondlife.com/badgeo/wakka.php?wakka=physicsyou will want to apply a force to set it moving a in a direction. There are other thing you will want to get such as mass so you know how much force you will need to apply to get it to move at a certian velocity. Actually you will want to apply an Impluse to it. Applying a force will make it accelerate. Just be ready for your ball to go flying off in space and don't close you script window.
|
|
Jason Foo
Old Timer
Join date: 6 Feb 2004
Posts: 105
|
07-21-2006 09:58
Have you ever thought of just using a sensor to detect the objects if you don't want it physical? You can simply activate a sensor in the detecting object, and when another object gets within .05 to .5 meters of the objects sensor, it will say its a collission!
_____________________
If my doctor told me I had only six minutes to live, I wouldn't brood. I'd type a little faster.
|
|
Gearsawe Stonecutter
Over there
Join date: 14 Sep 2005
Posts: 614
|
07-21-2006 10:05
From: Jason Foo Have you ever thought of just using a sensor to ... Great idea! Sometimes the simple ways are the best. Just don't do a sensor repeat. only really need to check once after it has moved.
|
|
Cate Baker
Registered User
Join date: 10 Nov 2005
Posts: 5
|
Useful responses
07-21-2006 10:23
Not only did you answer my question, you provided new information on how things work and alternative to accomplish the task. Thanks all.
|