Klasse SphereCollider

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

public class SphereCollider extends Collider
Represents a sphere collider, which has an (optional) offset and a radius
  • Konstruktordetails

    • SphereCollider

      public SphereCollider(float radius)
      Creates a new sphere collider which is centered to the object.
      Parameter:
      radius - the radius of the sphere.
    • SphereCollider

      public SphereCollider(float x, float y, float z, float radius)
      Creates a new sphere collider.
      Parameter:
      x - optional x offset.
      y - optional y offset.
      z - optional z offset.
      radius - the radius of the sphere.
    • SphereCollider

      public SphereCollider(float x, float y, float z, float radius, boolean isTrigger)
      Creates a new sphere collider.
      Parameter:
      x - optional x offset.
      y - optional y offset.
      z - optional z offset.
      radius - the radius of the sphere.
      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).
  • Methodendetails

    • getCenter

      public Vector3f getCenter()
    • getRadius

      public float getRadius()
    • 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.
      Gibt zurück:
      true if this is a ghost collider / trigger collider, false if not.