mirror of
https://github.com/photonstorm/phaser
synced 2024-12-22 19:13:37 +00:00
1 line
No EOL
6.1 KiB
JSON
1 line
No EOL
6.1 KiB
JSON
{"class":{"name":"Phaser.QuadTree","extends":"","static":false,"constructor":true,"parameters":[{"name":"x","type":["number"],"help":"The top left coordinate of the quadtree.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The top left coordinate of the quadtree.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the quadtree in pixels.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the quadtree in pixels.","optional":false,"default":null},{"name":"maxObjects","type":["number"],"help":"The maximum number of objects per node.","optional":true,"default":"10"},{"name":"maxLevels","type":["number"],"help":"The maximum number of levels to iterate to.","optional":true,"default":"4"},{"name":"level","type":["number"],"help":"Which level is this?","optional":true,"default":"0"}],"help":"A QuadTree implementation. The original code was a conversion of the Java code posted to GameDevTuts.\\nHowever I've tweaked it massively to add node indexing, removed lots of temp. var creation and significantly increased performance as a result.\\nOriginal version at https:\/\/github.com\/timohausmann\/quadtree-js\/"},"consts":[],"methods":{"public":[{"name":"clear","static":false,"returns":null,"help":"Clear the quadtree.","line":299,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"getIndex","static":false,"returns":{"types":["number"],"help":"index - Index of the subnode (0-3), or -1 if rect cannot completely fit within a subnode and is part of the parent node."},"help":"Determine which node the object belongs to.","line":210,"public":true,"protected":false,"private":false,"parameters":[{"name":"rect","type":["Phaser.Rectangle","object"],"help":"The bounds in which to check.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"insert","static":false,"returns":null,"help":"Insert the object into the node. If the node exceeds the capacity, it will split and add all objects to their corresponding subnodes.","line":157,"public":true,"protected":false,"private":false,"parameters":[{"name":"body","type":["Phaser.Physics.Arcade.Body","object"],"help":"The Body object to insert into the quadtree. Can be any object so long as it exposes x, y, right and bottom properties.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"populate","static":false,"returns":null,"help":"Populates this quadtree with the children of the given Group. In order to be added the child must exist and have a body property.","line":109,"public":true,"protected":false,"private":false,"parameters":[{"name":"group","type":["Phaser.Group"],"help":"The Group to add to the quadtree.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"populateHandler","static":false,"returns":null,"help":"Handler for the populate method.","line":121,"public":true,"protected":false,"private":false,"parameters":[{"name":"sprite","type":["Phaser.Sprite","object"],"help":"The Sprite to check.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"reset","static":false,"returns":null,"help":"Resets the QuadTree.","line":81,"public":true,"protected":false,"private":false,"parameters":[{"name":"x","type":["number"],"help":"The top left coordinate of the quadtree.","optional":false,"default":null},{"name":"y","type":["number"],"help":"The top left coordinate of the quadtree.","optional":false,"default":null},{"name":"width","type":["number"],"help":"The width of the quadtree in pixels.","optional":false,"default":null},{"name":"height","type":["number"],"help":"The height of the quadtree in pixels.","optional":false,"default":null},{"name":"maxObjects","type":["number"],"help":"The maximum number of objects per node.","optional":true,"default":"10"},{"name":"maxLevels","type":["number"],"help":"The maximum number of levels to iterate to.","optional":true,"default":"4"},{"name":"level","type":["number"],"help":"Which level is this?","optional":true,"default":"0"}],"inherited":false,"inheritedFrom":""},{"name":"retrieve","static":false,"returns":{"types":["array"],"help":"- Array with all detected objects."},"help":"Return all objects that could collide with the given Sprite or Rectangle.","line":254,"public":true,"protected":false,"private":false,"parameters":[{"name":"source","type":["Phaser.Sprite","Phaser.Rectangle"],"help":"The source object to check the QuadTree against. Either a Sprite or Rectangle.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"split","static":false,"returns":null,"help":"Split the node into 4 subnodes","line":135,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"protected":[],"private":[],"static":[]},"properties":{"public":[{"name":"bounds","type":["object"],"help":"","inlineHelp":"Object that contains the quadtree bounds.","line":45,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"level","type":["number"],"help":"","inlineHelp":"The current level.","line":40,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"maxLevels","type":["number"],"help":"","inlineHelp":"The maximum number of levels to break down to.","line":35,"default":"4","public":true,"protected":false,"private":false,"readOnly":false},{"name":"maxObjects","type":["number"],"help":"","inlineHelp":"The maximum number of objects per node.","line":29,"default":"10","public":true,"protected":false,"private":false,"readOnly":false},{"name":"nodes","type":["array"],"help":"","inlineHelp":"Array of associated child nodes.","line":55,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"objects","type":["array"],"help":"","inlineHelp":"Array of quadtree children.","line":50,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_empty","type":["array"],"help":"","inlineHelp":"Internal empty array.","line":61,"default":null,"public":false,"protected":false,"private":true,"readOnly":false}]}} |