Sign in to follow this  

[.net] ConstantTable.SetValue in C# with MDX & using Vector3?

This topic is 3846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK so I have my constant tables(type ConstantTable) and there is no overload for Vector3s... In C++ I could make a call to it like so: ConstantTable->SetFloatArray(device, handle, *Vector3,3) That was the overload function with( device, handle, float[],count). Well I cant use a pointer to a Vector3 in C# and there is no function overload that takes Vector3 type. So what is the best way to use this? Simply making a float[3] then filling it with x then y, then z. seems like another waste of space and time...Is there a better way? Also why is there no Vector3 overload? Thanks much, Brad

Share this post


Link to post
Share on other sites
yea that is possible, i just hate wasting memory and time.... thats all :(. I am trying to get the most out of all I can and it just seemed like it would have been a good idea to include a Vector3 & Vector3 function... not sure why they didnt include it...

Share this post


Link to post
Share on other sites
Vector4 is a struct, so if you convert on the fly you're not really wasting memory, or at least you're not putting extra pressure on the garbage collector. Making an array would, so you want to avoid making that allocation in your game loop. (Preallocating would avoid the problem though.)

Share this post


Link to post
Share on other sites

This topic is 3846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this