Exemplo n.º 1
0
Plane Frustum::GetPlane(int faceIndex) const
{
    assume(0 <= faceIndex && faceIndex <= 5);
    switch(faceIndex)
    {
        default: // For release builds where assume() is disabled, return always the first option if out-of-bounds.
        case 0: return NearPlane();
        case 1: return FarPlane();
        case 2: return LeftPlane();
        case 3: return RightPlane();
        case 4: return TopPlane();
        case 5: return BottomPlane();
    }
}
Exemplo n.º 2
0
CameraComponent::CameraComponent(std::string name /*= nullptr*/)
	: active(true), clearColor(.1f,.1f,.1f), Component_CRTP(name)
{
	LUA_OBJECT_START(CameraComponent);
	camManager.allCams.Register(this);

	viewDir = glm::vec3(0,0,-1);
	setPos(glm::vec3(0,0,0));

	perspectiveNeedsUpdate = true;

	NearPlane(.1f);
	FarPlane(100);
	
	uniforms[0] = ShaderUniformPram("nearPlane",   nearPlane   );
	uniforms[1] = ShaderUniformPram("farPlane" ,   farPlane    );
	uniforms[2] = ShaderUniformPram("perspective", perspective );
	uniforms[3] = ShaderUniformPram("world2View",  world2View  );
}