Howdy Folks.

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Howdy Folks.

Post by MrGodin » April 18th, 2019, 8:57 pm

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

User avatar
cyboryxmen
Posts: 190
Joined: November 14th, 2014, 2:03 am

Re: Howdy Folks.

Post by cyboryxmen » April 19th, 2019, 6:28 am

The old design was better 😏
Zekilk

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Howdy Folks.

Post by chili » April 19th, 2019, 6:33 am

I do prefer a dark theme.

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

MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Re: Howdy Folks.

Post by MrGodin » April 20th, 2019, 4:56 pm

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;
			};
		}
	};
Curiosity killed the cat, satisfaction brought him back

Post Reply