oahda
|
|
« Reply #560 on: February 19, 2016, 12:36:13 PM » |
|
Is there any common term for cubes and squares/rectangles that ignores the number of dimensions, and a corresponding one for spheres and circles (and possibly ovals)?
In my engine I separate 3D polygons from 2D polygons by calling them Polygon3D and Polygon2D, respectively, and the same for vectors with Vector2D versus Vector3D. It would feel nicely consistent to do something similar with the other ones if possible.
|
|
« Last Edit: February 19, 2016, 12:58:34 PM by Prinsessa »
|
Logged
|
|
|
|
Cheesegrater
Level 1
|
|
« Reply #561 on: February 19, 2016, 12:45:00 PM » |
|
Hypercube, hypersphere, etc. A 3D sphere is a 3-Hypersphere, often shortened to a 3-Sphere.
For a generic polygon the term is polytope.
|
|
|
Logged
|
|
|
|
oahda
|
|
« Reply #562 on: February 19, 2016, 12:56:47 PM » |
|
Guess I could use Sphere2D and Sphere3D then, but I don't like it. But it's all typedefs anyway, so I could still use an underlying Sphere<n, T> and then typedef Sphere<2, T> Circle<T> and typedef Sphere<3, T> Sphere<T> and still enjoy the perks of templates.
|
|
|
Logged
|
|
|
|
gimymblert
|
|
« Reply #563 on: February 19, 2016, 12:58:24 PM » |
|
|
|
|
Logged
|
|
|
|
BorisTheBrave
|
|
« Reply #564 on: February 19, 2016, 01:12:42 PM » |
|
I could still use an underlying Sphere<n, T>
There's really no point templating spheres or other shapes. Realistically, you are only going to have two distinct dimensions you care about, and some stuff doesn't generalize that nicely.
|
|
|
Logged
|
|
|
|
oahda
|
|
« Reply #565 on: February 19, 2016, 01:22:33 PM » |
|
I could still use an underlying Sphere<n, T>
There's really no point templating spheres or other shapes. Realistically, you are only going to have two distinct dimensions you care about, and some stuff doesn't generalize that nicely. Yeah, I realised quite soon — but it was still interesting to know whether there was any common term — for a perfectly round sphere, of course, there wouldn't be much of a difference: it just needs a radius, like the circle. A <whatever the term for a non-square 3D rectangle is?> would still need sizes in all dimensions, tho, in which case templates would tie nicely into my existing templated vectors, allowing me to add both the 3D version as well as 2D rectangles with just one set of instructions. I'm mostly pondering stuff! Theoretical questions are always interesting even if one does not end up using them. c:
|
|
|
Logged
|
|
|
|
Cheesegrater
Level 1
|
|
« Reply #566 on: February 19, 2016, 01:27:32 PM » |
|
A <whatever the term for a non-square 3D rectangle is?>
Rectangular cuboid.
|
|
|
Logged
|
|
|
|
oahda
|
|
« Reply #567 on: February 19, 2016, 01:31:36 PM » |
|
Geez. We need more basic, simple geometry terms!
|
|
|
Logged
|
|
|
|
Cheesegrater
Level 1
|
|
« Reply #568 on: February 19, 2016, 01:33:17 PM » |
|
To be fair, most people call it a box. But cuboid is the mathy way to say it.
|
|
|
Logged
|
|
|
|
oahda
|
|
« Reply #569 on: February 19, 2016, 01:44:09 PM » |
|
... *hits self* Of course.
|
|
|
Logged
|
|
|
|
ProgramGamer
|
|
« Reply #570 on: February 19, 2016, 01:59:14 PM » |
|
Boxoid and circuloid could be acceptable terms. They don't have to exist already, you can just coin the terms yourself!
|
|
|
Logged
|
|
|
|
oahda
|
|
« Reply #571 on: February 19, 2016, 05:13:33 PM » |
|
Coinoid!
|
|
|
Logged
|
|
|
|
insaneinside
|
|
« Reply #572 on: February 23, 2016, 03:06:46 AM » |
|
Depending on what you mean by "non-square", Frustum or Parallelpiped may be appropriate. The Wikipedia article for "Hyperrectangle" says that e.g. a rectangle is a 2-orthotope and a cube or right-rectangular prism is a 3-orthotope. It also says that "box" is a valid general term as well...
|
|
« Last Edit: February 23, 2016, 03:17:36 AM by insaneinside »
|
Logged
|
|
|
|
oahda
|
|
« Reply #573 on: February 23, 2016, 05:40:56 AM » |
|
It would be a tad funny to have a Box2D class since that's also the 2D physics engine I'm incorporating...
|
|
|
Logged
|
|
|
|
BorisTheBrave
|
|
« Reply #574 on: February 23, 2016, 02:32:45 PM » |
|
Fortunately, Box2D doesn't have a box type. Or use a Box2D namespace. I always thought that was weird.
|
|
|
Logged
|
|
|
|
oahda
|
|
« Reply #575 on: February 24, 2016, 04:33:06 AM » |
|
Everything is prefixed by b2- instead, C-style. AngelScript actually does the same with AS- (C++ stuff) and as- (macros). Weird indeed.
|
|
« Last Edit: February 24, 2016, 07:41:08 AM by Prinsessa »
|
Logged
|
|
|
|
Oats
Level 1
High starch content.
|
|
« Reply #576 on: February 25, 2016, 03:59:05 AM » |
|
Where's a good place to save files across the various OS, on mac I know it's something like user/system/Application Support/appname/, but what's the corresponding windows/linux? Or is it considered acceptable enough to just save things as invisible files on the root directory? (Although I always feel a little soiled when I find an app doing that on my computer).
|
|
|
Logged
|
eh
|
|
|
InfiniteStateMachine
|
|
« Reply #577 on: February 25, 2016, 07:17:15 AM » |
|
why not in a path relative to your executable?
|
|
|
Logged
|
|
|
|
ThemsAllTook
|
|
« Reply #578 on: February 25, 2016, 07:59:40 AM » |
|
why not in a path relative to your executable?
That's frowned upon these days, because modern operating systems don't expect users to necessarily have write access to the place where they store applications. It can be done, but certain users won't be happy about it. On Windows, I use getenv("APPDATA") and create a named subdirectory for game support files. Similar thing on Linux with ~/.config as the base directory. OS X has an API for this (NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES)), which returns ~/Library/Application Support as the first item.
|
|
|
Logged
|
|
|
|
InfiniteStateMachine
|
|
« Reply #579 on: February 25, 2016, 09:37:41 AM » |
|
Really? I hate games that put data in APPDATA. I'm pretty sure there's a class of users that also hate the non-localized storage method. If I want to move the game to another computer I can't just copy over the directory using an environment method.
Has windows changed their policy in win10? Because I've never heard of not having write access to the directory your game is installed in previous versions.
I can certainly see that being the case with linux etc since they tend to take a bit more of a heavy handed approach to security.
|
|
|
Logged
|
|
|
|
|