Game Development Community

How to use shape vectors?

by Philip Mansfield · in Torque Game Builder · 04/23/2006 (4:01 am) · 5 replies

I can't spot anything in the documentation for them, and I think for my next mini-project they'll be quite handy. Is it also possible to tell if the mouse (or any other object) is inside the boundaries of a given shape?

#1
04/23/2006 (10:52 am)
Odd... Their Google Mini is no longer finding the results. There were a couple of threads that showed how to use them. It's pretty easy and I've used them myself. The main catches are that you have to form closed shapes and you have to define a convex collision polygon using coordinates from x: [-1, 1] and y: [-1, 1]. So, unfortunately, you cannot easily create shapes that are in world coordinates, that have non-convex collision polygons, and are open.
#2
04/23/2006 (10:53 am)
The other thing that bit me was there wasn't a way to set the "thickness" of the vectors, even though it's a simple property of glLines. All lines will be exactly 1 pixel thick, regardless of resolution.
#3
04/23/2006 (11:15 am)
Closed shapes are fine, but convex only shapes are a problem for what I want. It's not too important, I'll just use imagemaps instead :)
#4
04/23/2006 (1:43 pm)
Non convex in the end is only a combination of several convex shapes ... that should not be that much of a problem ...
#5
04/23/2006 (2:17 pm)
But I need them to all act as one shape when the cursor moves over part of one. So it's a load of mounts, and a load of other commands that I need to work through. Much easier to use an ImageMap for what I want.