Class

io.scalajs.dom.html.phaser

QuadTree

Related Doc: package phaser

Permalink

class QuadTree extends Object

A QuadTree implementation. The original code was a conversion of the Java code posted to GameDevTuts. However I've tweaked it massively to add node indexing, removed lots of temp. var creation and significantly increased performance as a result.

Annotations
@RawJSType() @native() @JSName( "Phaser.QuadTree" )
Version

2.6.2

See also

http://phaser.io/docs/2.6.2/Phaser.QuadTree.html

Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. QuadTree
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new QuadTree(x: Double, y: Double, width: Double, height: Double, maxObjects: Int = js.native, maxLevels: Int = js.native, level: Int = js.native)

    Permalink

    x

    The top left coordinate of the quadtree.

    y

    The top left coordinate of the quadtree.

    width

    The width of the quadtree in pixels.

    height

    The height of the quadtree in pixels.

    maxObjects

    The maximum number of objects per node.

    maxLevels

    The maximum number of levels to iterate to.

    level

    Which level is this?

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. var bounds: Any

    Permalink

    Object that contains the quadtree bounds.

  6. def clear(): Unit

    Permalink

    Clear the quadtree.

  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def getIndex(rect: Phaser.Rectangle): Int

    Permalink

    Determine which node the object belongs to.

    Determine which node the object belongs to.

    rect

    The bounds in which to check.

    returns

    index - Index of the subnode (0-3), or -1 if rect cannot completely fit within a subnode and is part of the parent node.

  13. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  14. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  15. var height: Double

    Permalink

    The height of the quadtree in pixels.

  16. def insert(body: Body): Unit

    Permalink

    Insert the object into the node.

    Insert the object into the node. If the node exceeds the capacity, it will split and add all objects to their corresponding subnodes.

    body

    The Body object to insert into the quadtree. Can be any object so long as it exposes x, y, right and bottom properties.

  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  19. var level: Int

    Permalink

    Which level is this?

  20. var maxLevels: Int

    Permalink

    The maximum number of levels to iterate to.

  21. var maxObjects: Int

    Permalink

    The maximum number of objects per node.

  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. var nodes: Array[_]

    Permalink

    Array of associated child nodes.

  24. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. var objects: Array[_]

    Permalink

    Array of quadtree children.

  27. def populate[T](group: Phaser.Group[T]): Unit

    Permalink

    Populates this quadtree with the children of the given Group.

    Populates this quadtree with the children of the given Group. In order to be added the child must exist and have a body property.

    group

    The Group to add to the quadtree.

  28. def populateHandler(sprite: Phaser.Sprite): Unit

    Permalink

    Handler for the populate method.

    Handler for the populate method.

    sprite

    The Sprite to check.

  29. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  30. def reset(x: Double, y: Double, width: Double, height: Double, maxObjects: Int = js.native, maxLevels: Int = js.native, level: Int = js.native): Unit

    Permalink

    Resets the QuadTree.

    Resets the QuadTree.

    x

    The top left coordinate of the quadtree.

    y

    The top left coordinate of the quadtree.

    width

    The width of the quadtree in pixels.

    height

    The height of the quadtree in pixels.

    maxObjects

    The maximum number of objects per node.

    maxLevels

    The maximum number of levels to iterate to.

    level

    Which level is this?

  31. def retrieve[T](source: |[Phaser.Sprite, Phaser.Rectangle]): Array[T]

    Permalink

    Return all objects that could collide with the given Sprite or Rectangle.

    Return all objects that could collide with the given Sprite or Rectangle.

    source

    The source object to check the QuadTree against. Either a Sprite or Rectangle.

    returns

    Array with all detected objects.

  32. def split(): Unit

    Permalink

    Split the node into 4 subnodes

  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  34. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  35. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  36. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  37. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. var width: Double

    Permalink

    The width of the quadtree in pixels.

  41. var x: Double

    Permalink

    The top left coordinate of the quadtree.

  42. var y: Double

    Permalink

    The top left coordinate of the quadtree.

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped