Class BoxCollider

java.lang.Object
net.risingworld.api.collider.Collider
net.risingworld.api.collider.BoxCollider

public class BoxCollider extends Collider
Represents a box collider, which has an (optional) offset and a size
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.risingworld.api.collider.Collider

    Collider.Type
  • Constructor Summary

    Constructors
    Constructor
    Description
    BoxCollider(float sizeX, float sizeY, float sizeZ)
    Creates a new box collider which is centered to the object.
    BoxCollider(float sizeX, float sizeY, float sizeZ, boolean isTrigger)
    Creates a new box collider which is centered to the object.
    BoxCollider(float x, float y, float z, float sizeX, float sizeY, float sizeZ)
    Creates a new box collider.
    BoxCollider(float x, float y, float z, float sizeX, float sizeY, float sizeZ, boolean isTrigger)
    Creates a new box collider.
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    boolean
    Gets whether or not this is a "ghost collider".

    Methods inherited from class net.risingworld.api.collider.Collider

    getType

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BoxCollider

      public BoxCollider(float sizeX, float sizeY, float sizeZ)
      Creates a new box collider which is centered to the object.
      Parameters:
      sizeX - the width (size along x axis) of the box.
      sizeY - the height (size along y axis) of the box.
      sizeZ - the length/depth (size along z axis) of the box.
    • BoxCollider

      public BoxCollider(float sizeX, float sizeY, float sizeZ, boolean isTrigger)
      Creates a new box collider which is centered to the object.
      Parameters:
      sizeX - the width (size along x axis) of the box.
      sizeY - the height (size along y axis) of the box.
      sizeZ - the length/depth (size along z axis) of the box.
      isTrigger - if true, this becomes a ghost collider (i.e the player doesn't collide with it, but you can still use it for raycasts).
    • BoxCollider

      public BoxCollider(float x, float y, float z, float sizeX, float sizeY, float sizeZ)
      Creates a new box collider.
      Parameters:
      x - optional local x offset.
      y - optional local y offset.
      z - optional local z offset.
      sizeX - the width (size along x axis) of the box.
      sizeY - the height (size along y axis) of the box.
      sizeZ - the length/depth (size along z axis) of the box.
    • BoxCollider

      public BoxCollider(float x, float y, float z, float sizeX, float sizeY, float sizeZ, boolean isTrigger)
      Creates a new box collider.
      Parameters:
      x - optional local x offset.
      y - optional local y offset.
      z - optional local z offset.
      sizeX - the width (size along x axis) of the box.
      sizeY - the height (size along y axis) of the box.
      sizeZ - the length/depth (size along z axis) of the box.
      isTrigger - if true, this becomes a ghost collider (i.e the player doesn't collide with it, but you can still use it for raycasts).
  • Method Details

    • getCenter

      public Vector3f getCenter()
    • getSize

      public Vector3f getSize()
    • isTrigger

      public boolean isTrigger()
      Gets whether or not this is a "ghost collider". This means the player won't collide with it (i.e he can simply walk through this collider), but it can still be used for raycasts etc.
      Returns:
      true if this is a ghost collider / trigger collider, false if not.