Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 Nov 2013
Offline Last Active Apr 29 2016 02:56 PM

Posts I've Made

In Topic: linked list of struct that is derived from another c++

29 April 2016 - 02:55 PM

I'm not sure I follow, do you want a linked list that can hold one of several different structure types?


Could you do this via the std::List and a structure that was




  enum innerType



     struct1 one;

     struct2 two;

     struct3 three;



// or a void* pointer if you're allocating those somewhere


In Topic: getting fired in software industry

29 April 2016 - 01:06 PM

It can be really hard on the ego when one gets let go, even if it's a mass layoff.  It is possible to recover, and even be successful.  I've seen folks go from being fired for not working out, to working someplace new, and getting promoted to a lead in a short amount of time.

In Topic: Would this light saber style weapon have any copyright issues with disney?

29 April 2016 - 10:06 AM

Their have been enough "not quite" lightsabers around that I think you're fine as long as you don't directly copy the effect or the sound.

In Topic: Hi, Im Dave and I'm an Generic-aholic.

29 April 2016 - 10:04 AM

Yeah, the 2 times then refactor on the third has been my general rule as well.

In Topic: Optimizing Generation

26 April 2016 - 04:38 PM

That is kind of odd.  What is the distance of a chunk from?   You might try bucketing the chunks a bit more by putting them in an octree or some other data structure.  (These 16 chunks are in a leaf at dist X, who are in turn placed in branch that contains 4 other leafs, that has a distance of Y, etc)


Also, how often are you sorting?  Sorting 15,000 things once shouldn't be a problem.  Also, I have a sneaking suspicion that CompareTo probably offers terrible performance in Unity Mono.  I would try doing that by manually comparing w values and seeing if you see any performance boost.  EDIT:  It all depends on whether it calls the CompareTo() that takes an object, or the concrete type.  Some more internet searches seem to lean towards it calling the concrete type, and you should be fine.


EDIT2:  Oh, but this seems to lean towards my suspicion, though that was for Unity on phone.  Anyway, easy enough to check, and probably worth giving it a test.  It also has a full listing of what CompareTo is doing for floats, and might explain any mild speedups you get with a more naive comparison.  Which you might be able to get away with if you don't think you're going to get any NaNs or +/- Infinities in your list.  (Which you could probably test for on insert, or elsewhere)