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

Added default primitive to geometry #1523

Merged
merged 1 commit into from
May 31, 2016
Merged

Conversation

fernandojsg
Copy link
Member

Description:
When you try to add an empty entity with an empty geometry Aframe throws an error as it looks for a primitive value to return the expected geometryBuffer.
We should add a default value so empty component doesn't give you any error and also give you some kind of basic behaviour (the same as if you put an empty material).
So basically what I've done is add a default: 'box' to the primitive schema and you'll get a box by default.
Fixes #1514

@ngokevin
Copy link
Member

Small test for geometry component just to check an empty primitive doesn't throw error?

@fernandojsg
Copy link
Member Author

Test added.

@@ -16,6 +16,11 @@ suite('geometry', function () {
});

suite('update', function () {
test('empty geometry', function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coudl do allows empty geometry to be more specific

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a big deal though, can merge anyways

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@dmarcos dmarcos merged commit e8681b7 into aframevr:master May 31, 2016
@ngokevin
Copy link
Member

Thanks, I was waiting for the tests to pass, then eventually forgot about it.

@fernandojsg fernandojsg deleted the default branch March 14, 2017 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants