Jump to content
  • Advertisement

Ant

Member
  • Content Count

    8
  • Joined

  • Last visited

Community Reputation

124 Neutral

About Ant

  • Rank
    Newbie
  1. Im afraid you lost me at cone axis. I was referring to use pyramid instead of cones in case I wasnt clear.
  2. Cone. Of course. Funny I never thought of them as cones even though that is exactly what they are.   Now suppose if I want to use pyramids in addition to cones, then what I need to do is 4 vector-plane normal test to check whether or not the forward vector is inside the specified "range." What I am uncertain about is how to clamp the forward vector to inside the pyramid if it was outside?    If the dot product between forward vector and plane normal is negative, then I need to "rotate" the vector to be same "direction" as the plane (not sure on the correct mathematical term). Problem is how do I do this "rotation"?
  3. What I want to do is to set a limit on the allowed direction/forward of an object in 3D. In 2D, that would be say a angle range [0-45] degrees and an object's angle is clamped to within those range. Now I want something equivalent in 3D. It is not quite a orientation as I dont care for Z roll. So I am wondering how this is usually done? Ideally, the said structure should allow for a test to check whether a quaternion or rotation matrix is within its specified range. Or if it easier, test whether the object's current direction/forward is within the specified range.
  4. I do. And I care because I am writing a webgl App which uses javascript. Which is slower than c++ by default and also lacks the compiler.    I understand your point but this is game dev and not a general programming site. Sometimes performance do matter.
  5. I see. I was hoping that somebody did the work to simplify the math. Its very possible that many of the cross, dot and other math operations are redundant in doing the convert quat then divide route.
  6. Ant

    Easier OBB-OBB intersect test

    Use points alone is not sufficient to determine whether an object is in another. Consider this case in 2D:   A                 A                             B                           B     A                  A        B                            B   None of the points in B is in A but the 2 objects are in fact colliding. 
  7. So basically "convert the 2 orientations to quaternions first" ?
  8. I know you can calculate the quaternion rotation between 2 vectors with something like this after all the optimizations:   quat quat::fromtwovectors(vec3 u, vec3 v) {     vec3 w = cross(u, v);     quat q = quat(dot(u, v), w.x, w.y, w.z);     q.w += q.magnitude();     return normalize(q); }   However, this returns the shortest quaternion rotation between vec u and vec v. Is there a way to calculate a quaternion rotation between orientation A (with a dir vector and up vector ) and orientation B? I guess you could convert the 2 orientations to quaternions first but is there a more direct method? something like       quat quat::from_two_orientations(vec3 u_dir, vec3 u_up, vec3 v_dir, vec3 v_up)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!