Author Topic: Unique Shapes With Triggers And Physical Zones?  (Read 2126 times)

Is it possible to use the polyhedron in triggers and physical zones to make it a shapes that's not rectangular? How does the polyhedron work?

I believe the polyhedron is a set of points in the form x1 y1 z1 x2 y2 z2 x3 y3 z3, etc...

These points are relative to the trigger position. With that information you should be able to make whatever shape you want.

I tried messing with the polyhedron. It just seemed to break the physical zone and not really change the shape much.

From the source:

/* Console polyhedron data type loader
   The polyhedron type is really a quadrilateral and consists of an corner
   point follow by three vectors representing the edges extending from the
   corner.
*/


You can only make boxes.

For example, 0 0 0 1 0 0 0 -1 0 0 0 1 from here will get you a 1x1x1 tu cube with one point on the position of the trigger. You could center it by trying something like -0.5 0.5 -0.5 1 0 0 0 -1 0 0 0 1 but there doesn't seem to be any way to make a different shape.

The only method would be to make clever rotations and scaling to offer different shapes then.

From the source:

/* Console polyhedron data type loader
   The polyhedron type is really a quadrilateral and consists of an corner
   point follow by three vectors representing the edges extending from the
   corner.
*/


You can only make boxes.

For example, 0 0 0 1 0 0 0 -1 0 0 0 1 from here will get you a 1x1x1 tu cube with one point on the position of the trigger. You could center it by trying something like -0.5 0.5 -0.5 1 0 0 0 -1 0 0 0 1 but there doesn't seem to be any way to make a different shape.
Then why not just change the scale of it instead?

Then why not just change the scale of it instead?
Because that would be too easy.


I have no idea, maybe setting a polyhedron for your box and leaving the scale at 1 is more efficient

Because that would be too easy.


I have no idea, maybe setting a polyhedron for your box and leaving the scale at 1 is more efficient
I place my Triggers at the center of my brick and then scale from there, both methods seem to work just fine.

Then why not just change the scale of it instead?

Because scale is relative to objects and polyhedron is relative to datablocks. If you needed every trigger of type X to have a specific size, it would make more sense to define its size in the datablock than set the scale on every object. Also, with polyhedrons you can have rotated quadrilaterals.
« Last Edit: July 13, 2015, 03:14:18 AM by $trinick »

Because scale is relative to objects and polyhedron is relative to datablocks. If you needed every trigger of type X to have a specific size, it would make more sense to define its size in the datablock than set the scale on every object.

Eh? The polyhedron is a property of the individual trigger objects, not the trigger datablock.

Also, with polyhedrons you can have rotated quadrilaterals.

Can you rotate triggers with setTransform? That would make it pointless.

Eh? The polyhedron is a property of the individual trigger objects, not the trigger datablock.

That it is. Guess I forgot or something.