-
MapPortion.checkCollisionRay
(positionBefore, positionAfter, object)boolean
static
-
Check collision ray
Name |
Type |
Description |
positionBefore |
THREE.Vector3
|
The position before collision |
positionAfter |
THREE.Vector3
|
The position after collision |
object |
MapObject
|
The map object to test collision |
Returns:
-
-
Apply transform for lands bounding box
Name |
Type |
Description |
box |
THREE.Mesh
|
The mesh bounding box |
boundingBox |
Array.<number>
|
The bounding box list parameters |
-
-
Apply transform for sprite bounding box
Name |
Type |
Description |
box |
THREE.Mesh
|
The mesh bounding box |
boundingBox |
Array.<number>
|
The bounding box list parameters |
-
-
Apply transform for oriented bounding box
Name |
Type |
Description |
box |
THREE.Mesh
|
The mesh bounding box |
boundingBox |
Array.<number>
|
The bounding box list parameters |
-
MapPortion.createBox
()THREE.Mesh
static
-
Create a box for bounding box
Returns:
Type |
Description |
THREE.Mesh
|
|
-
MapPortion.createOrientedBox
()THREE.Mesh
static
-
Create an oriented box for bounding box
Returns:
Type |
Description |
THREE.Mesh
|
|
-
-
Read the JSON associated to the map portion
Name |
Type |
Description |
json |
Object
|
Json object describing the map portion |
isMapHero |
boolean
|
Indicates if this map is where the hero is
at the beginning of the game. |
-
-
Read the JSON associated to the lands in the portion
Name |
Type |
Description |
json |
Object
|
Json object describing the lands |
-
-
Read the JSON associated to the floors in the portion
Name |
Type |
Description |
json |
Object
|
Json object describing the floors |
-
-
Read the JSON associated to the autotiles in the portion
Name |
Type |
Description |
json |
Object
|
Json object describing the autotiles |
-
-
Read the JSON associated to the sprites in the portion
Name |
Type |
Description |
json |
Object
|
Json object describing the sprites |
-
readSpritesGlobals
(json)
-
Read the JSON associated to the sprites globals in the portion
Name |
Type |
Description |
json |
Object
|
Json object describing the sprites globals |
-
-
Read the JSON associated to the sprites walls in the portion
Name |
Type |
Description |
json |
Object
|
Json object describing the sprites walls |
-
-
Read the JSON associated to the mountains in the portion
Name |
Type |
Description |
json |
Object
|
Json object describing the mountains |
-
-
Read the JSON associated to the objects 3D in the portion
Name |
Type |
Description |
json |
Object
|
Json object describing the objects 3D |
-
readObjects
(json, isMapHero)
-
Read the JSON associated to the objects in the portion
Name |
Type |
Description |
json |
Object
|
Json object describing the objects |
isMapHero |
boolean
|
Indicates if this map is where the hero is
at the beginning of the game |
-
-
Remove all the objects from the scene
-
-
Search for the object with the ID
Name |
Type |
Description |
json |
Object
|
Json object describing the objects |
id |
number
|
The ID of the object |
Returns:
-
-
Get hero model
Name |
Type |
Description |
json |
Object
|
Json object describing the objects |
Returns:
-
updateFaceSprites
(angle)
-
Update the face sprites orientation
Name |
Type |
Description |
angle |
number
|
The angle on the Y axis |
-
updateCollisionSprite
(collisions, position)
-
Update the collision sprite
Name |
Type |
Description |
collisions |
Array.<Object>
|
The collisions objects |
position |
Array.<number>
|
The json position of the sprite |
-
updateCollision
(boundingBoxes, collisions, position, side)
-
Update the collision sprite
Name |
Type |
Description |
boundingBoxes |
Array.<Object>
|
The bounding boxes list to update |
collisions |
Array.<Object>
|
The collisions objects |
position |
Array.<number>
|
The json position of the sprite |
side |
boolean
|
Indicate if collision side |
-
getObjectCollisionAt
(positionSource, positionTarget, kind)
-
Get the object collision according to position
Name |
Type |
Description |
positionSource |
Array.<number>
|
The source json position |
positionTarget |
Array.<number>
|
The target json position |
kind |
ElementMapKind
|
The element map kind |
-
-
Add a position to non empty
Name |
Type |
Description |
position |
Array.<number>
|
The position to add |
-
isPositionIn
(position)boolean
-
Check if position if in this map portion
Name |
Type |
Description |
position |
Array.<number>
|
The position to check |
Returns:
-
checkCollision
(jpositionBefore, jpositionAfter, positionAfter, object, direction, testedCollisions)boolean
-
Check if there is a collision at this position
Name |
Type |
Description |
jpositionBefore |
Array.<number>
|
The json position before collision |
jpositionAfter |
Array.<number>
|
The json position after collision |
positionAfter |
THREE.Vector3
|
The position after collision |
object |
MapObject
|
The map object collision test |
direction |
THREE.Vector3
|
The direction collision |
testedCollisions |
Array.<Object>
|
The object collisions that were
already tested |
Returns:
-
checkLandsCollision
(jpositionBefore, jpositionAfter, object, direction, testedCollisions)boolean
-
Check if there is a collision with lands at this position
Name |
Type |
Description |
jpositionBefore |
Array.<number>
|
The json position before collision |
jpositionAfter |
Array.<number>
|
The json position after collision |
object |
MapObject
|
The map object collision test |
direction |
THREE.Vector3
|
The direction collision |
testedCollisions |
Array.<Object>
|
The object collisions that were
already tested |
Returns:
-
checkLandsCollisionInside
(jpositionBefore, jpositionAfter, direction)boolean
-
Check if there is a collision with lands with directions
Name |
Type |
Description |
jpositionBefore |
Array.<number>
|
The json position before collision |
jpositionAfter |
Array.<number>
|
The json position after collision |
direction |
THREE.Vector3
|
The direction collision |
Returns:
-
checkIntersectionLand
(collision, boundingBox, object)boolean
-
Check intersection between ray and an object
Name |
Type |
Description |
collision |
Object
|
The collision object |
boundingBox |
Array.<number>
|
The bounding box values |
object |
MapObject
|
The map object to check |
Returns:
-
checkDirections
(jpositionBefore, jpositionAfter, collision, boundingBox, direction, object)boolean
-
Check directions
Name |
Type |
Description |
jpositionBefore |
Array.<number>
|
The json position before collision |
jpositionAfter |
Array.<number>
|
The json position after collision |
collision |
Object
|
The collision object |
boundingBox |
Array.<number>
|
The bounding box values |
direction |
THREE.Vector3
|
The direction collision |
object |
MapObject
|
The map object collision test |
Returns:
-
checkDirectionsInside
(jpositionBefore, jpositionAfter, collision, direction)boolean
-
Check directions inside
Name |
Type |
Description |
jpositionBefore |
Array.<number>
|
The json position before collision |
jpositionAfter |
Array.<number>
|
The json position after collision |
collision |
Object
|
The collision object |
direction |
THREE.Vector3
|
The direction collision |
Returns:
-
checkSpritesCollision
(jpositionAfter, testedCollisions, object)boolean
-
Check if there is a collision with sprites at this position
Name |
Type |
Description |
jpositionAfter |
Array.<number>
|
The json position after collision |
testedCollisions |
Array.<Object>
|
The object collisions that were
already tested |
object |
MapObject
|
The map object collision test |
Returns:
-
checkIntersectionSprite
(boundingBox, fix, object)boolean
-
Check intersection between ray and an object
Name |
Type |
Description |
boundingBox |
Array.<number>
|
The bounding box values |
fix |
boolean
|
Indicate if the sprite is fix or not |
object |
MapObject
|
The map object collision test |
Returns:
-
checkObjects3DCollision
(jpositionAfter, testedCollisions, object)boolean
-
Check if there is a collision with sprites at this position
Name |
Type |
Description |
jpositionAfter |
Array.<number>
|
The json position after collision |
testedCollisions |
Array.<Object>
|
The object collisions that were
already tested |
object |
MapObject
|
The map object collision test |
Returns:
-
checkMountainsCollision
(jpositionAfter, positionAfter, testedCollisions, object)boolean
-
Check if there is a collision with mountains at this position
Name |
Type |
Description |
jpositionAfter |
Array.<number>
|
The json position after collision |
positionAfter |
THREE.Vector3
|
The position after collision |
testedCollisions |
Array.<Object>
|
The object collisions that were
already tested |
object |
MapObject
|
The map object collision test |
Returns:
-
checkMountainCollision
(jpositionAfter, positionAfter, testedCollisions, object, objCollision, yMountain, block)boolean
-
Check if there is a collision with mountains at this position
Name |
Type |
Description |
jpositionAfter |
Array.<number>
|
The json position after collision |
positionAfter |
THREE.Vector3
|
The position after collision |
testedCollisions |
Array.<Object>
|
The object collisions that were
already tested |
object |
MapObject
|
The map object collision test |
objCollision |
Object
|
The object collision |
yMountain |
number
|
The y mountain collision |
block |
boolean
|
The block mountain collision |
Returns:
-
checkIntersectionMountain
(jpositionAfter, positionAfter, objCollision, object)boolean
-
Check intersection with a mountain
Name |
Type |
Description |
jpositionAfter |
Array.<number>
|
The json position after collision |
positionAfter |
THREE.Vector3
|
The position after collision |
objCollision |
Object
|
The object collision |
object |
MapObject
|
The map object collision test |
Returns:
-
checkObjectsCollision
(object)boolean
-
Check collision with objects
Name |
Type |
Description |
object |
MapObject
|
The map object collision test |
Returns:
-
checkObjectsCollisionList
(list, object)boolean
-
Check collision with objects
Name |
Type |
Description |
list |
Array.<MapObject>
|
The map objects list to test |
object |
MapObject
|
The map object collision test |
Returns: