Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

naming issue for ray constructor #13

Open
ofZach opened this issue Dec 20, 2017 · 1 comment
Open

naming issue for ray constructor #13

ofZach opened this issue Dec 20, 2017 · 1 comment

Comments

@ofZach
Copy link

ofZach commented Dec 20, 2017

Granted I didn't really look at any example code, where it's very clear:

https://github.com/elliotwoods/ofxRay/blob/master/ofxRay_ofPlanePrimitiveExample/src/ofApp.cpp#L37-L41

but I found the naming scheme for ofRay a little unclear and struggled with this a little while:

Ray::Ray(ofVec3f s, ofVec3f t, bool infinite) {
	this->defined = true;
	this->s = s;
	this->t = t;
	this->infinite = infinite;
	this->width = 2.0f;
}

when I saw s / t I just thought I should supply two points on the ray, but actually I need to supply a point and a direction.... (I guess t stands for transmission... I kind of read s/t like u/v)

maybe changing the name of these variables might help?

great addon btw 👍

@elliotwoods
Copy link
Owner

yes, you're right
's' and 't' are somewhere between:

  • Vector algebra world (everything becomes a letter)
  • Computing world (descriptive names are preferred)

Also the fact that everything has a color and 'defined' flag is a bit silly

Ideally it should follow oF standard like ofDrawRay(myRay, flagsAndOtherThings)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants