1.9 KiB
ScriptBox.offset
Parça 1/2 · sonraki
offset(double x, double y, double z)
void Offsets the box by given coordinates function main(c) { var box = mappet.box(-10, 4, -10, 10, 6, 10); box.offset(10, 0, 10); c.send(box.toString()); // ScriptBox(0.0, 4.0, 0.0, 20.0, 6.0, 20.0) }
java.lang.String toString()
Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Field Detail minX
public double minX
minY
public double minY
minZ
public double minZ
maxX
public double maxX
maxY
public double maxY
maxZ
public double maxZ
Constructor Detail ScriptBox
public ScriptBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
Method Detail toString
public java.lang.String toString()
Overrides: toString in class java.lang.Object
isColliding
public boolean isColliding(ScriptBox box)
offset
public void offset(double x, double y, double z)
Offsets the box by given coordinates
function main(c) { var box = mappet.box(-10, 4, -10, 10, 6, 10); box.offset(10, 0, 10); c.send(box.toString()); // ScriptBox(0.0, 4.0, 0.0, 20.0, 6.0, 20.0) }
contains
public boolean contains(double x, double y, double z)
Checks if given coordinates are inside of this box
function main(c) { var box = mappet.box(-10, 4, -10, 10, 6, 10); if (box.contains(0, 4, 0)){ c.send("this point is inside the box") } if (box.contains(0, 7, 0)){ c.send("this point is outside the box") } }
contains
public boolean contains(ScriptVector vector)
Checks if given coordinates are inside of this box
function main(c) { var subject = c.getSubject(); var subjectPosition = subject.getPosition();