Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- # include <sig/gs_vec.h>
- class collision {
- private:
- GsVec position, pos_top;
- float radius;
- bool type;
- public:
- collision(GsVec pos, float r) : position(pos), radius(r) { type = true; }
- collision(GsVec bot, GsVec top) : position(bot), pos_top(top) { type = false; }
- bool contains(GsVec pnt, float r) {
- if(type) return (distmax(pnt, position) < radius + r);
- else {
- return (pnt.x > position.x && pnt.y > position.y && pnt.z > position.z && pnt.x < pos_top.x && pnt.y < pos_top.y && pnt.z < pos_top.z);
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement