Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 23 Oct 2003
Offline Last Active Nov 10 2015 06:58 PM

Posts I've Made

In Topic: Rear View Camera Matrix

17 June 2011 - 04:46 PM

It's probably the forward vector you want to negate, rather than the target point.

If you're using a 'look at' function that takes a position and a target point, you should be able to compute the adjusted target point as follows (pseudocode):

vector3 forward = target - position;
vector3 adjusted_target = position - forward;

In Topic: Stack Overflow? (Operator Overloading)

17 June 2011 - 04:42 PM

again using just a plain char* because I cannot afford any overhead.

The only way I can see use of std::vector adding any overhead would be if, for some reason, accessing the vector data via the [] operator were slower than accessing a raw array. However, I wouldn't assume that would be the case; if you have your optimization settings set appropriately (including the relevant preprocessor definitions if you're using MSVC), I would expect vector::operator[]() to be plenty fast. (But, you can always profile to find out for sure.)

On the other hand, *not* using an RAII container can add a fair amount of development overhead in terms of coding, testing, debugging, and maintenance. (For example, you now have to worry about the 'rule of three', exception safety, and so on.)

Note that I'm not advocating for any particular approach here; I'm just suggesting that making assumptions when it comes to performance and optimization can sometimes result in doing extra work for little or no gain.

In Topic: Questions about Blender Game Engine

17 June 2011 - 01:07 PM

i would try mocking it up but i would think that it would require scripting experience which i still need to gain.

Sure, it'll most likely require programming regardless of which engine you use. But, if you already have some experience with Python (which was the impression I got from your earlier post), that should give you a good head start irrespective of which language or engine you use. (And, you can always learn as you go, of course.)

In Topic: Questions about Blender Game Engine

17 June 2011 - 12:44 PM

Ok... does anyone know any good scripting tutorials for BGE or Unity so i can get to know thier full power.

I don't have any particular suggestions for BGE, but a search for 'bge tutorial' turns up some promising-looking links.

For Unity, try searching the forums over there for 'javascript tutorial, 'unityscript tutorial', and even just 'tutorial', and you should find links to the resources that are most often suggested to beginning users.

Also, jyk, if you could really make a mock- up it would be frickin' AWESOME!

Well, by "I'd just try mocking up the basics of your game", I just meant, "If I were you, I'd just try mocking up the basics of your game" :) Anyway, the point is that a little experimentation will probably answer most of your questions fairly quickly.

In Topic: Box2d object x y location

17 June 2011 - 11:18 AM

That would be the top left buddy

I don't believe that's correct - what leads you to believe the position of a body corresponds to the top left?

Generally, there will be two things associated with a body: a shape (or shapes), and a visual representation. It's common for these to match (roughly, at least), but they don't have to.

Regarding the shape, IIRC, there are a few options available, such as circles and convex polygons. Generally, the position will correspond to the center of the shape (more or less), although you could probably create an 'off-center' polygon where the position corresponded to some other point.

Regarding the visual, you can position the visual wherever you want with respect to the position of the body. Typically though, the positioning of the visual will roughly match that of the shape or shapes associated with the body.