Page 1 of 1

Howdy Folks.

Posted: April 18th, 2019, 8:57 pm
by MrGodin
Been a long time, since i've been here. New digs looks good!. When was the new format implemented?. Cheers

Re: Howdy Folks.

Posted: April 19th, 2019, 6:28 am
by cyboryxmen
The old design was better 😏

Re: Howdy Folks.

Posted: April 19th, 2019, 6:33 am
by chili
I do prefer a dark theme.

How are you doing my fellow compatriot of the canuckistanian persuasion? Any coding lately?

Re: Howdy Folks.

Posted: April 20th, 2019, 4:56 pm
by MrGodin
Hey Chili, yes been doing the opengl thing lately working in 2D. Seems easier to implement than Direct3D.
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;
			};
		}
	};