module Oid::CollisionFuncs

Extended Modules

Defined in:

oid/core/collision_funcs.cr

Instance Method Summary

Instance Method Detail

def bounding_box_for_asset(e : Oid::CollidableEntity, asset_width, asset_height) : Oid::Element::BoundingBox #

[View source]
def bounding_box_for_element(e : Oid::CollidableEntity) : Oid::Element::BoundingBox #

[View source]
def bounding_box_for_entity(e : Oid::CollidableEntity) : Oid::Element::BoundingBox #

Will return a Oid::Element::BoundingBox for the provided entity or raise error


[View source]
def calc_overlap_rec(data) #

Calculate the orgin and size of the overlap between two rectangles see #rec_overlap_data for +data+ format


[View source]
def calc_rec_origin(origin_type : Oid::Enum::OriginType, width, height) : Oid::Vector2 #

[View source]
def collision_ray_box?(ray : Oid::Ray, box : Oid::Element::BoundingBox) : Bool #

[View source]
def collision_rec(e1 : Oid::CollidableEntity, e2 : Oid::CollidableEntity) #

Return a rectangle that is the area of overlap with the collision


[View source]
def collision_recs?(box1 : Oid::Element::BoundingBox, box2 : Oid::Element::BoundingBox) : Bool #

Check collision between two bounding boxes


[View source]
def collision_recs?(e1 : Oid::CollidableEntity, e2 : Oid::CollidableEntity) : Bool #

Check collision between two Entites


[View source]
def rec_overlap_data(box1 : Oid::Element::BoundingBox, box2 : Oid::Element::BoundingBox) #

Formats the overlap data for two Oid::Element::BoundingBox objects


[View source]