Skip to content

Conversation

@RoseThornrime
Copy link
Contributor

@RoseThornrime RoseThornrime commented Sep 4, 2025

  • update the physics system to match other systems: change components' names, reuse transform component for position, remove nesting in components
  • add an interactive example
  • add angular movement
  • make collider points' positions relative to the transform
  • implement OBB collider
  • implement the SAT algorithm (much faster than GJK for simple 2D shapes)
  • implement: circle collider, triangle collider, vertical and horizontal line colliders
  • rewrite collision actions to events like in the input system

@RoseThornrime
Copy link
Contributor Author

RoseThornrime commented Sep 16, 2025

how to add angular movement:

  • write a helper function to get quaternion from angle
  • rotate a point around the center
  • add angular velocity and use it for angular movement

@Chris-plusplus
Copy link
Member

Chris-plusplus commented Sep 16, 2025

how to add angular movement:

  • write a helper function to get quaternion from angle

It's possible that glm has such functions implemented

@RoseThornrime
Copy link
Contributor Author

The best thing I've found is sth like:

inline Quat quaternion(f32 angle) {
	return glm::angleAxis(glm::radians(angle), float3(0.0f, 0.0f, 1.0f));
}

and I've added it to Math.h

@RoseThornrime
Copy link
Contributor Author

RoseThornrime commented Sep 16, 2025

It's also more convenient because we're writing a 2D engine, so you can avoid using quaternions directly in examples

		auto& transform = e.addComponent<scene::components::TransformComponent>({
			listenerPosition,
			quaternion(0.0f),
			{ 100.0f, 50.0f, 0.0f },
		});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants