//------------------------------------------------------------------------------------
// irr::scene::ICameraSceneNode wrappers (parent is ISceneNode)
//------------------------------------------------------------------------------------

extern "C" 
{

f32 IrrScene_ICameraSceneNode_getAspectRatio(ICameraSceneNode* cam)
{
	if (cam)
		return cam->getAspectRatio();
	else return 0;
}
 
f32 IrrScene_ICameraSceneNode_getFarValue(ICameraSceneNode* cam)
{
	if (cam)
		return cam->getFarValue();
	else return 0;
}

f32 IrrScene_ICameraSceneNode_getFOV(ICameraSceneNode* cam)
{
	if (cam)
		return cam->getFOV();
	else return 0;
}

f32 IrrScene_ICameraSceneNode_getNearValue(ICameraSceneNode* cam)
{
	if (cam)
		return cam->getNearValue();
	else return 0;
}

matrix4* IrrScene_ICameraSceneNode_getProjectionMatrix(ICameraSceneNode* cam)
{
	if (cam)
		return new matrix4(cam->getProjectionMatrix());
	else return 0;
}

vector3df* IrrScene_ICameraSceneNode_getTarget(ICameraSceneNode* cam)
{
	if (cam)
		return new vector3df(cam->getTarget());
	else return 0;
}

vector3df* IrrScene_ICameraSceneNode_getUpVector(ICameraSceneNode* cam)
{
	if (cam)
		return new vector3df(cam->getUpVector());
	else return 0;
}

matrix4* IrrScene_ICameraSceneNode_getViewMatrix(ICameraSceneNode* cam)
{
	if (cam)
		return new matrix4(cam->getViewMatrix());
	else return 0;
}

const SViewFrustum* IrrScene_ICameraSceneNode_getViewFrustum(ICameraSceneNode* cam)
{
	if (cam)
		return cam->getViewFrustum();
	else return 0;
}

bool IrrScene_ICameraSceneNode_isInputReceiverEnabled(ICameraSceneNode* cam)
{
	if (cam)
		return cam->isInputReceiverEnabled();
	else return false;
}

void IrrScene_ICameraSceneNode_setAspectRatio(ICameraSceneNode* cam,f32 aspect)
{
	if (cam)
		cam->setAspectRatio(aspect);
}

void IrrScene_ICameraSceneNode_setFarValue(ICameraSceneNode* cam,f32 zf)
{
	if (cam)
		cam->setFarValue(zf);
}

void IrrScene_ICameraSceneNode_setFOV(ICameraSceneNode* cam,f32 fovy)
{
	if (cam)
		cam->setFOV(fovy);
}

void IrrScene_ICameraSceneNode_setNearValue(ICameraSceneNode* cam,f32 nv)
{
	if (cam)
		cam->setNearValue(nv);
}

void IrrScene_ICameraSceneNode_setInputReceiverEnabled(ICameraSceneNode* cam,bool enabled)
{
	if (cam)
		cam->setInputReceiverEnabled(enabled);
}

void IrrScene_ICameraSceneNode_setProjectionMatrix(ICameraSceneNode* cam, matrix4* projection, bool isOrthogonal = false)
{
	if (cam)
		cam->setProjectionMatrix(*projection, isOrthogonal);
}

void IrrScene_ICameraSceneNode_setTarget(ICameraSceneNode* cam,vector3df* pos)
{
	if (cam)
		cam->setTarget(*pos);
}

void IrrScene_ICameraSceneNode_setUpVector(ICameraSceneNode* cam,vector3df* pos)
{
	if (cam)
		cam->setUpVector(*pos);
}

bool IrrScene_ICameraSceneNode_OnEvent(ICameraSceneNode* cam,SEvent* event)
{
	if (cam)
		return cam->OnEvent(*event);
	else return false;
}

bool IrrScene_ICameraSceneNode_isOrthogonal(ICameraSceneNode* cam)
{
	if (cam)
		return cam->isOrthogonal();
	else return false;
}

void IrrScene_ICameraSceneNode_setRotation(ICameraSceneNode* cam, const core::vector3df* rotation) 
{
	if (cam)
		cam->setRotation(*rotation);
}

void IrrScene_ICameraSceneNode_bindTargetAndRotation(ICameraSceneNode* cam, bool bound)
{
	if (cam)
		cam->bindTargetAndRotation(bound);
}

bool IrrScene_ICameraSceneNode_getTargetAndRotationBinding(ICameraSceneNode* cam)
{
	if (cam)
		return cam->getTargetAndRotationBinding();
	else return false;
}

void IrrScene_ICameraSceneNode_setViewMatrixAffector(ICameraSceneNode* cam, const matrix4& affector) {
	if (cam)
		cam->setViewMatrixAffector(affector);
}

// must delete
matrix4* IrrScene_ICameraSceneNode_getViewMatrixAffector(ICameraSceneNode* cam) {
	if (cam)
		return new matrix4(cam->getViewMatrixAffector());
	else return 0;
}

} // extern "C"