Luc Aubret
Oreo-eater
Join date: 14 Sep 2005
Posts: 86
|
09-14-2005 10:13
I'm writing several "bullet" scripts that will do stuff on collision, but only when they detects that the bullet has collided with an avatar. I'm firing all of these "bullets" at the same velocity, which is approximately 30 m/s (?). So far, I've been testing the bullets using the same basic Semi Auto script found in 23,000 freebie guns floating around SL.
I'm finding that some of these bullets, because of minute variations in aim, require ultra-precise aim to actually detect collision with an agent. I can fix this by making the bullet into a giant ball, but then I get some fairly annoying recoil.
Can any of you recommend a bullet shape/size (the bullets are invisible anyway; I'm putting particle effects in to serve as a tracer) that is ideal for detecting collision with an avatar (I don't know which part of the bullet has to hit the avatar to detect said collision) without causing me some uncomfortable recoil?
|
Eggy Lippmann
Wiktator
Join date: 1 May 2003
Posts: 7,939
|
09-14-2005 16:47
If you're willing to have a multi prim bullet object, I believe the ideal bullet would be something made of flattened cubes arranged like this: ||||||| The multiple surfaces will provide a higher probability of collision detection. Bear in mind that the physics simulation supposedly runs at 45 fps. This means that if a bullet can go through an av in less than 1/45 seconds it will not be detected.
|
Bond Harrington
Kills Threads At 500yds
Join date: 15 May 2005
Posts: 198
|
09-14-2005 16:58
I've never heard of that, but I suspect multiple surfaces have an effect. I know there was talk about this same subject a couple of days ago and somebody mentioned that a long thinned tubes, possibly hollowed-out, were the best bullet for collision detection.
I've had a problem where the script doesn't run properly on collision. Most often I get ricochets. Would going the stacked box route or long tube solve this?
|
Damanios Thetan
looking in
Join date: 6 Mar 2004
Posts: 992
|
09-14-2005 18:39
Both Eggy and Bond are right. Either multiple surfaces because havok1 uses edge/boundary detection and not volume detection. (It could be that linked objects are treated differently though, so maybe firing multiple 1 prim bullets is better than 1 multiprim bullet) Or long elongated surfaces to increase the collision time and chance a collision is detected, due to the 'distinct' (cycle based) nature of the havok1 physics engine. According to both points, it could well be that the surface/volume ratio has an effect on detection, which would explain hollowed prims to be more effective. Remember though, the more complex the colliding shapes, the harder the physics engine has to work (lag) and the bigger the chance of a so called 'deep thought' killing the sim. Andrew Linden once gave some insight in how the collision detection in SL works and how make it 'optimal'. In this case in answer on how to best construct walls to stop bullets. The same concepts are valid for the bullets themselves though. Andrew Lindens hotline post
|