2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 22:27:41 +00:00

Various implementatations

This commit is contained in:
2016-04-29 03:08:46 -07:00
parent 10dcbaa6c9
commit 00a98bce85
37 changed files with 341 additions and 138 deletions

View File

@@ -19,7 +19,7 @@ bool CFrustumPlanes::BoxInFrustumPlanes(const zeus::CAABox& box) const
{
}
bool CFrustumPlanes::BoxInFrustumPlanes(const std::experimental::optional<zeus::CAABox>& box) const
bool CFrustumPlanes::BoxInFrustumPlanes(const rstl::optional_object<zeus::CAABox>& box) const
{
}

View File

@@ -3,7 +3,7 @@
#include "zeus/CTransform.hpp"
#include "zeus/CAABox.hpp"
#include "optional.hpp"
#include "rstl.hpp"
namespace urde
{
@@ -16,7 +16,7 @@ public:
bool PointInFrustumPlanes(const zeus::CVector3f& point) const;
bool SphereInFrustumPlanes(const zeus::CSphere& sphere) const;
bool BoxInFrustumPlanes(const zeus::CAABox& box) const;
bool BoxInFrustumPlanes(const std::experimental::optional<zeus::CAABox>& box) const;
bool BoxInFrustumPlanes(const rstl::optional_object<zeus::CAABox>& box) const;
};
}

View File

@@ -103,8 +103,8 @@ void CGraphics::SetAlphaCompare(ERglAlphaFunc comp0, u8 ref0, ERglAlphaOp op, ER
void CGraphics::SetViewPointMatrix(const zeus::CTransform& xf)
{
g_ViewMatrix = xf;
g_ViewPoint = xf.m_origin;
zeus::CMatrix3f tmp(xf.m_basis[0], xf.m_basis[2], -xf.m_basis[1]);
g_ViewPoint = xf.origin;
zeus::CMatrix3f tmp(xf.basis[0], xf.basis[2], -xf.basis[1]);
g_GXViewPointMatrix = zeus::CTransform(tmp.transposed());
SetViewMatrix();
}
@@ -119,8 +119,8 @@ void CGraphics::SetViewMatrix()
/* Load position matrix */
/* Inverse-transpose */
g_GXModelViewInvXpose = g_GXModelView.inverse();
g_GXModelViewInvXpose.m_origin.zeroOut();
g_GXModelViewInvXpose.m_basis.transpose();
g_GXModelViewInvXpose.origin.zeroOut();
g_GXModelViewInvXpose.basis.transpose();
/* Load normal matrix */
}

View File

@@ -12,7 +12,7 @@ namespace urde
static logvisor::Module Log("urde::CModelBoo");
bool CBooModel::g_DrawingOccluders = false;
static std::experimental::optional<CModelShaders> g_ModelShaders;
static rstl::optional_object<CModelShaders> g_ModelShaders;
CBooModel::CBooModel(std::vector<CBooSurface>* surfaces, SShader& shader,
boo::IVertexFormat* vtxFmt, boo::IGraphicsBufferS* vbo, boo::IGraphicsBufferS* ibo,
@@ -204,7 +204,7 @@ void CBooModel::ActivateLights(const std::vector<CLight>& lights)
continue;
CModelShaders::Light& lightOut = m_lightingData.lights[curLight++];
lightOut.pos = CGraphics::g_CameraMatrix * light.x0_pos;
lightOut.dir = CGraphics::g_CameraMatrix.m_basis * light.xc_dir;
lightOut.dir = CGraphics::g_CameraMatrix.basis * light.xc_dir;
lightOut.dir.normalize();
lightOut.color = light.x18_color;
lightOut.linAtt[0] = light.x24_distC;
@@ -372,14 +372,14 @@ void CBooModel::UVAnimationBuffer::ProcessAnimation(u8*& bufOut, const UVAnimati
matrixOut.vec[0].x = 0.5f;
matrixOut.vec[1].y = 0.0f;
matrixOut.vec[2].y = 0.5f;
matrixOut.vec[3].x = CGraphics::g_GXModelMatrix.m_origin.x * 0.5f;
matrixOut.vec[3].y = CGraphics::g_GXModelMatrix.m_origin.y * 0.5f;
matrixOut.vec[3].x = CGraphics::g_GXModelMatrix.origin.x * 0.5f;
matrixOut.vec[3].y = CGraphics::g_GXModelMatrix.origin.y * 0.5f;
break;
}
case UVAnimation::Mode::WhoMustNotBeNamed:
{
zeus::CTransform texmtx = CGraphics::g_ViewMatrix.inverse() * CGraphics::g_GXModelMatrix;
texmtx.m_origin.zeroOut();
texmtx.origin.zeroOut();
/* TODO: Finish */
matrixOut = texmtx.toMatrix4f();
break;

View File

@@ -18,7 +18,7 @@ CSkinnedModel::CSkinnedModel(IObjectStore& store, ResId model,
}
void CSkinnedModel::Calculate(const CPoseAsTransforms& pose,
const std::experimental::optional<CVertexMorphEffect>&)
const rstl::optional_object<CVertexMorphEffect>&)
{
}