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

thirdparty example addition #48

Open
pdJeeves opened this issue Oct 6, 2018 · 0 comments
Open

thirdparty example addition #48

pdJeeves opened this issue Oct 6, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@pdJeeves
Copy link

pdJeeves commented Oct 6, 2018

I honestly can't remember how to suggest adding it with git's interface.

This file defines data structures so that accessors can be interacted with as STL containers

E.g:
` std::vectorglm::vec3 position;

for (auto const & attrib : primitive.attributes)
{
	if(attrib.first == "POSITION")
	{
		stdAccessorVec3 position_array(document, attrib.second);
		position = std::vector<glm::vec3>(position_array.begin(), position_array.end());
	}
}`

std::array<float, 3> should work just as well as glm::vec3

When given a fx::gltf::Document &, int accessor pair it will throw an error if there is any risk of a buffer overrun when the iterator class is used in a standard way.

could stand to undergo more testing (especially with sparse structures), but works for my purposes.

stl_accessor.zip

EDIT: i realized i messed up the ampersands on the interator preinc/postinc, GCC didn't complain because the STL algorithms i was feeding it to wasn't using the one with a bad reference.

@jessey-git jessey-git added the enhancement New feature or request label Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants