Search the Community
Showing results for tags 'raycast'.
-
Hello. My use case: Have a project idea that would benefit of a detailed llCastArray() friendly surface. Which i think is a physic shape, but the down side is un-necessary load on the server as it can be complex or many small ones that will add up, when its only purpose is to be invisible and an be an recipient surface llCastArray(). So my question is: Can a physic shape be made server friendly in the sense of a medium/high vertex count ?
-
i think i figured out what i'm doing wrong. i am trying to calculate the angle of a slope between two points. point 1 = the spot directly below the avatar where it is standing. (in region coordinates) point 2 = the spot the ray intersects the ground ahead of the avatar. (in region coordinates, translated from the avatar's local forward axis) and i have this formula: angle = RAD_TO_DEG*( llAtan2( (p2.z - p1.z),(p2.x - p1.x) )); i THINK the problem is, that i'm just using the X and Z coordinates, and not correcting for
-
so on my slope quest... i have two coordinates, one that is right below my avatar, and one that is about 2 meters ahead of it. these are raycast coordinates, shooting out from the avatar's center point. anyway, i have gotten the formula that the angle of the slope is Tan^-1 (slope). and slope = (z2 - z1)/ (x2 - x1). vector p1 = llList2Vector(res1, 1); vector p2 = llList2Vector(res2, 1); float angle = llPow(llTan( (p2.z - p1.z)/(p2.x - p1.x) ), -1); so tangent of the slope to the -1 power. i'm standing
-
i know i know how to do this... sorta. but i can't seem to figure it out. okay, i'm trying to ray cast from an attachment, and i want to get the spot straight down from the center of my avatar (easy, thats llGetPos and lower the z coordinate), and "ahead" of my avatar. which i know is local pos + x, BUT... to get that in region coordinates, compared to which way my avatar is facing, i need to use (i think??) Rot2Fwd. i'm just... not sure where/how? vector fwd = llRot2Fwd( llGetLocalRot() ); vector targetPos = llGetPos() + (fwd* ht); this is from the exam
- 7 replies
-
- raycast
- coordinates
-
(and 1 more)
Tagged with:
-
This script is intended to help show exactly where the ray travels and what it hits, if anything. All you need to do is manually adjust the visualizer's position and rotation using the build tools, and touch the object to "fire" a ray. The length of the ray can be adjusted by saying any length in local chat, and the visualizer will adjust to it. To get set up, rez 3 (of any) prims, link them together, and then put this script in. It will create an object like this: And here it is in action, hitting the inside of a hollow sphere: Here's the code: float length =