Howdy Folks.
Howdy Folks.
Been a long time, since i've been here. New digs looks good!. When was the new format implemented?. Cheers
Curiosity killed the cat, satisfaction brought him back
- cyboryxmen
- Posts: 190
- Joined: November 14th, 2014, 2:03 am
Re: Howdy Folks.
I do prefer a dark theme.
How are you doing my fellow compatriot of the canuckistanian persuasion? Any coding lately?
How are you doing my fellow compatriot of the canuckistanian persuasion? Any coding lately?
Chili
Re: Howdy Folks.
Hey Chili, yes been doing the opengl thing lately working in 2D. Seems easier to implement than Direct3D.
Sample of some stuff.
Sample of some stuff.
Code: Select all
class CPhysics : public Component
{
private:
Transform* transform = nullptr;
Movement2D* movement = nullptr;
Collider* collider = nullptr;
public:
std::function<Physics::Intersection(Collider& other)> collideRect;
std::function<Physics::Intersection(Collider& other)> collideSphere;
std::function<Physics::Intersection(Math::vec2& target, Collider& otherCollider)> lineOfSight;
CPhysics() {}
~CPhysics() {}
virtual void init()override
{
transform = &owner->getComponent<Transform>();
movement = &owner->getComponent<Movement2D>();
collider = &owner->getComponent<Collider>();
collideRect = [=](Collider& other)
{
return Physics::AABB2D_AABB2D(collider->getAABB(), other.getAABB());
};
collideSphere = [=](Collider& other)
{
Physics::Intersection inter;
inter = Physics::Sphere2D_Sphere2D(collider->getSphere(), other.getSphere());
return inter;
};
lineOfSight = [=](Math::vec2& target, Collider& otherCollider)
{
Math::vec2 pos(collider->getSphere().getCenter());
Line_2D line(pos, target);
Physics::Intersection inter;
inter = Physics::line_AABB2D(line, otherCollider.getAABB());
return inter;
};
}
};
Curiosity killed the cat, satisfaction brought him back