Jump to content
  • Advertisement
Sign in to follow this  
xsirxx

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

This topic is 4061 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
Advertisement
Just make the array, it won't be that wasteful.
Alternatively, use the Vector4 version.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!