-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Added VelocityVectorProperty #3908
Conversation
@hpinkos can you review this? |
|
||
var property = this._position; | ||
if (Property.isConstant(property)) { | ||
return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't this be the zero vector instead of undefined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I guess if you wanted the vector to always be normalized this makes sense. Just wanted to double check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other properties seem to return undefined when there isn't a value at that time. This code was pretty much copied from the VectorOrientationProperty
. @mramato is returning undefined
the right thing to do here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, undefined
just gets translated to "use the default" which is probably the best case scenario here.
@tfili can we rewrite |
expect(property.isConstant).toBe(true); | ||
expect(property.definitionChanged).toBeInstanceOf(Event); | ||
expect(property.position).toBeUndefined(); | ||
expect(property.getValue(time)).toBe(undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.toBe(undefined)
-> .toBeUndefined()
@tfili just had that one question |
@mramato this should be good for another look. |
* @param {Property} [position] The position property used to compute the velocity. | ||
* | ||
* @example | ||
* //Create an entity with position and orientation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is now incorrect. I would recommend updating it to illustrate orienting a billboard along it's velocity vector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is still incorrect. Change it to something like //Create an entity with a billboard rotated to match its velocity
Just that one last comment. |
@mramato Updated the code sample. |
Also, please merge in master. |
@mramato Master is merged and the comment is fixed. |
Thanks @tfili |
Added
VelocityVectorProperty
so billboard's aligned axis can follow the velocity vector. Tests were also added.