Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Jun 2000
Offline Last Active Yesterday, 11:03 PM

Posts I've Made

In Topic: Moving from plain "ascii" to XML?

Yesterday, 01:20 PM

http://yaml.org/ , in particular, yaml-cpp. From their example/tutorial:

YAML::Node config = YAML::LoadFile("config.yaml");

if (config["lastLogin"]) {
  std::cout << "Last logged in: " << config["lastLogin"].as<DateTime>() << "\n";

const std::string username = config["username"].as<std::string>();
const std::string password = config["password"].as<std::string>();
login(username, password);
config["lastLogin"] = getCurrentDateTime();

std::ofstream fout("config.yaml");
fout << config;

In Topic: C++ : Extend class in dll

17 October 2016 - 12:41 PM

A slightly more concrete example, which also walks through the differences between the naive and mature approaches...



In Topic: Coding-Style Poll

16 October 2016 - 11:12 PM

I've completely given up on self-maintaining a code style. I require the tab character behave as indentation, because indentation is what tab does. (I'm looking at you, Stanza and Python. You can either accept One Space or One Tab, 'cause I'm not slapping the space key two, four, or eight times just to make your anal-retentive developers happy).


But whether I'm using visual layout style I like or not, every time I or anyone else working on one of my projects hits "Save," a code beautifier/formatter is run on the file first, because inter-developer inter-temporal source control consistency is, in the long term, more important than subtle tweaks to persnickety readability quirks. If you can't automate enforcement of your coding guidelines, they're not worth enforcing.

In Topic: Implementing Box2D into isometric question.

14 October 2016 - 03:26 PM

@Tangletail; as in, converting world space coordinates to view space?


I will grant that the Articles system is not as good as it used to be on this site, but there are a crapton of articles about all manners of 2D graphics topics still on this site. Try this one.



In Topic: What is the general name for types like Quadtrees and Octrees etc

13 October 2016 - 09:01 AM

Know that there is also Kd-trees. It's like BSP, but you don't store a vector-per-split; you just store a magnitude. Each split's axis is determined from its depth in the tree, modulo the number of dimensions, e.g. the root node splits on the X axis, the next level splits on the Y axes of the two X parts, the next level splits on the Z axes of the four Y parts, and the next level splits on X again. Ideally you want to split an equal number of elements to either side of each split.


The main advantages over BSP as a spatial search structure (as opposed to BSP's main uses in the 90s as a spatial *traversal* structure) is that the tree is easier to build, and there's no vector math involved to test which side of a split a point or object is on, only axis-aligned-bounds checks.