Aller au contenu

Photo

Orientation of cube in GetFirstObjectInShape() (resolved)


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I am making an area damage script and I want the area to be rectangular.  Since that is not an option, I was thinking of using two adjascent cubes.  The catch is that they have to have the same orientation so that no single object gets both effects.

when you pass the location parameter into the function, does the function automatically use the orientation part of the location in determining the orientation of the cubes?

Modifié par M. Rieder, 13 juin 2011 - 07:15 .


#2
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
As far as I can tell, the cube does use the orientation component of the location. I did extensive testing with a rather amusing grid of kobolds to see the pattern that the cubes make. There was no overlap and the pattern appeared appropriate for the used orientation. It was also a lot of fun.

#3
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Good info thanks. I'm pretty sure you didn't originally get an answer because nobody knew. I had no clue.

#4
MasterChanger

MasterChanger
  • Members
  • 686 messages
Indeed, good to know.

One other thing to think about: you aren't necessarily ultimately limited to the shapes that Get*ObjectInShape accepts. You can circumscribe the shape you care about with one of the accepted shapes, and can then test mathematically whether it's in the sub-shape.

For example, you can surround your rectangle with a circle/square/cylinder. Then you can test the position of objects retrieved by the Get*ObjectInShape functions to see whether they're within the x-y values you care about.

#5
SkywingvL

SkywingvL
  • Members
  • 351 messages
If you're curious, here are the (unstated) other parameters used in determining the shape dimensions for the GetObjectInShape routines:

ShapeTypeSpellCylinder, // Cylinder with radius = 1.5f
ShapeTypeCone, // Maximum radius = Size
ShapeTypeCube, // Half length of side = Size
ShapeTypeSpellCone, // locked to 60 degree arc
ShapeTypeSphere, // Radius = Size

#6
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

MasterChanger wrote...

Indeed, good to know.

One other thing to think about: you aren't necessarily ultimately limited to the shapes that Get*ObjectInShape accepts. You can circumscribe the shape you care about with one of the accepted shapes, and can then test mathematically whether it's in the sub-shape.

For example, you can surround your rectangle with a circle/square/cylinder. Then you can test the position of objects retrieved by the Get*ObjectInShape functions to see whether they're within the x-y values you care about.



Hey, that sounds much better than lining two cubes up next to each other.  What functions are used in the process?