new RigidRectangle(xform, w, h) → {RigidRectangle}
Parameters:
Name | Type | Description |
---|---|---|
xform |
Transform | Transform object |
w |
Number | Width of rectangle |
h |
Number | Height of rectangle |
- Source:
Returns:
New instance of RigidRectangle
- Type
- RigidRectangle
Methods
collided(otherShape, collisionInfo) → {Boolean}
Check for collision between this and RigidShape
Parameters:
Name | Type | Description |
---|---|---|
otherShape |
RigidShape | RigidShape object to check for collision status against |
collisionInfo |
CollisionInfo | Collision info of collision |
Returns:
true if collision occurs
- Type
- Boolean
collidedRectRect(r1, r2, collisionInfo) → {Boolean}
Check for collision between RigidRectangle and RigidRectangle
Parameters:
Name | Type | Description |
---|---|---|
r1 |
RigidRectangle | Rectangle object to check for collision status |
r2 |
RigidRectangle | Rectangle object to check for collision status against |
collisionInfo |
CollisionInfo | Collision info of collision |
Returns:
true if collision occurs
- Type
- Boolean
containsPos(pos) → {Boolean}
Check if RigidShape contains position
Parameters:
Name | Type | Description |
---|---|---|
pos |
vec2 | Position to check |
Returns:
true if position is in RigidShape
- Type
- Boolean
draw(aCamera) → {void}
Draw function called by GameLoop
Parameters:
Name | Type | Description |
---|---|---|
aCamera |
Camera | Camera to draw too |
- Source:
Returns:
- Type
- void
getHeight() → {Number}
Return the height of the rectangle
- Source:
Returns:
Height of rectangle
- Type
- Number
getWidth() → {Number}
Return the width of the rectangle
- Source:
Returns:
Width of rectangle
- Type
- Number
rigidType() → {enum|eRigidType}
Return the type of Rigidshape
- Source:
Returns:
- Type
- enum | eRigidType
setColor(color) → {void}
Set the Color of the position marker and sides
Parameters:
Name | Type | Description |
---|---|---|
color |
Array.<Float> | new color of marker and sides [R, G, B, A] |
- Source:
Returns:
- Type
- void