an island off Cape Cod - where they traditionally spend Thanksgiving. The SDF of a radial line segment can be used to determine intersection between any point and a radial line segment, I have no clue if this is the typical approach to a spherecast, but, it is extremely cheap, and mathematically accurate.The president and first lady Jill Biden called in from their vacation in Nantucket, Mass. The last and fully complete approach is to create an SDF for the shape from its vertices, which is possible for convex shapes, and more difficult for concave shapes. A better approach is to define an SDF for the shape using line segments between the vertices of each face (creating a wiremesh type shape) and using that. One approach is to apply the SDF to every vertex, which leaves gaps, but is typically accurate enough. IIRC you can also do this between two SDFs (I think it can be achieved by subtracting the two SDFs to get a new SDF or something and using the center point of either, I forgor though) for a radial line segment) you can determine if a point intersects if the distance <= 0. I’ve sort of found that SDFs are great for implementing special casts between a piece of complex geometry and a shape that’s easy to define an SDF for, since they tell you if a point is inside, outside, or on the edge of a surface, and they tell you how far. It also generalizes to all kinds of other shapes, anything you can define an SDF for, which basically includes everything. This is not related to Roblox or this request, but I thought it was cool to bring up a mathematical version of spherecasting using signed distance fields (SDFs) for the people that are interested. The workaround is to use a cylinder part and two sphere intersections but this doesn’t necessarily work the same. It’s important to note that since a lot of the use cases people would like sphere casting for aren’t covered by plain sphere intersection, and sphere casting can achieve the same sphere intersection by using the same two points as the start and end points. Sphere casting is a raycast with a radius, but the existing implementation is not a sphere cast it’s just sphere intersection. You should be able to achieve a plane intersection with box intersection I think but it might not be the exact case you’re looking for, since it would only tell you “yes this intersects a plane” and not where on the plane.Ĭc also want to note since this has been bumped, the method for sphere intersection that’s in the engine isn’t actually sphere casting. I believe a few of these are in the engine so far, though I don’t think they’re enabled. All around I think these sorts of casts deserve focus. I think that raycasts, boxcasts, and spherecasts are all very important, and it is extremely important we have efficient means to perform these types of things.Īnd, ideally, raycasting, boxcasting, and spherecasting should be as fast as they possibly can be, as they are fundamental to some of the most core mechanics in a lot of non-Roblox games. Sphere casting would be very useful when you need “big raycasts.”Īlso, pointed out below that Boxcasting would be a similarly appreciated feature. Sphere casting in-engine has the added benefit of not requiring the use of physical part objects and thus would be significantly faster than current methods.Īdditionally games like Super Smash Bros use something similar sphere casting for combat, and if I’m not mistaken do in some cases use sphere casting. Sphere casting as a feature would allow for more projectile types, and much much more CPU efficient custom explosions. (You can think of it like a sphere at each start and end point with a cylinder in between). Unity has a sphere cast feature, and its effectively a raycast with a spherical radius all the way around it. If Roblox is able to address this issue, it would improve my development experience because it would allow for much, much more complicated interactions in games. As a Roblox developer, it is currently too hard to do fast sphere casts in Roblox.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |