Skip to main content
GameDev.net gamedev.net
🔒 Locked

Help with collision tutorial

Started by muimui1911 Sep 15, 2005 at 6:17 AM 0 replies 450+ views
Original Post
muimui1911
muimui1911
Hello everyone: I have read telemachos's tutorials both the "collision response" and "improved collision and response" and I have the following questions: The following codes are from the from collision response here is the codes for that part: //////////////////////////////////////////// double intersectRayPlane(D3DVECTOR rOrigin, D3DVECTOR rVector, D3DVECTOR pOrigin, D3DVECTOR pNormal) { double d = - (dot(pNormal,pOrigin)); double numer = dot(pNormal,rOrigin) + d; double denom = dot(pNormal,rVector); if (denom == 0) // normal is orthogonal to vector, cant intersect return (-1.0f); return -(numer / denom); } ///////////////////////////////////////////// from the code above, I don't know what "d" exactly is and why the "numer = dot(pNormal,rOrigin) + d" and why the distance to okane in world units(return values) = -(numer / denom) besically, I don't understand codes for this particle function. I would really appreciate if anyone could help to understand this? Millions of thanks [Edited by - muimui1911 on September 15, 2005 6:56:08 AM]
dimebolt
dimebolt
Quote:
Original post by muimui1911
from the code above, I don't know what "d" exactly is and why the "numer = dot(pNormal,rOrigin) + d"


I didn't read the article, but it looks like 'd' is the d from the plane equation of the plane to intersect with.

Tom

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.