Spyro (DAE's 3D Engine Overlord)

The main aim throughout the year was to fill the engine with features ranging from skinning to particles, to finally create a demo game inside it. The full project will soon be on github. I created a spyro like demo game. The project shows enemies working with path movement and FOV. The player is able to jump, fly and spit fire at the enemies. The goal of the demo is to collect all diamonds.

Down here you can see a code snippet from my enemy FOV function.

//Raycast
auto physxProxy = m_pSpyroGame->GetPhysxProxy();
auto rayStart = PxVec3(m_pRayStart->GetTransform()->GetWorldPosition().x,
m_pRayStart->GetTransform()->GetWorldPosition().y, 
                    m_pRayStart->GetTransform()->GetWorldPosition().z);
auto rayDir = PxVec3(direction.x, direction.y, direction.z);

PxReal distancePX = m_FOVDistance;
PxRaycastBuffer hit;
if (physxProxy->Raycast(rayStart, rayDir, distancePX, hit))
{
	if (hit.hasBlock)
	{
		auto userData = hit.block.actor->userData;
 		if (userData != nullptr)
		{
			BaseComponent *base = (BaseComponent*)userData;
			GameObject *gameObject = base->GetGameObject();
			if (gameObject->GetTag() == L"Player")
			{
				m_SpottedTime = gameContext.pGameTime->GetTotal();
				m_SpottedPlayer = true;
				m_FOVDistance = m_FollowDistance;
			}
		}
	}
}