zeus constexpr refactor and thermal visor fixes

This commit is contained in:
Jack Andersen 2019-02-23 21:15:54 -10:00
parent 1186b8097c
commit 8df0a4913c
226 changed files with 1339 additions and 1305 deletions

View File

@ -12,25 +12,6 @@
<option name="SPACE_AFTER_REFERENCE_IN_DECLARATION" value="true" />
</Objective-C>
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="hpp" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />

View File

@ -130,7 +130,8 @@ else()
message(STATUS "Building with x87 Vector ISA")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -Werror=implicit-fallthrough -fno-exceptions -fno-rtti -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -Werror=implicit-fallthrough \
-Wno-unknown-warning-option -Wno-lto-type-mismatch -fno-exceptions -fno-rtti -Werror")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations")

View File

@ -279,7 +279,7 @@ bool ReadMAPAToBlender(hecl::blender::Connection& conn, const MAPA& mapa, const
"bm.free()\n";
const zeus::CMatrix4f* tmpMtx = pakRouter.lookupMAPATransform(entry.id);
const zeus::CMatrix4f& mtx = tmpMtx ? *tmpMtx : zeus::CMatrix4f::skIdentityMatrix4f;
const zeus::CMatrix4f& mtx = tmpMtx ? *tmpMtx : zeus::skIdentityMatrix4f;
os.format(
"mtx = Matrix(((%f,%f,%f,%f),(%f,%f,%f,%f),(%f,%f,%f,%f),(0.0,0.0,0.0,1.0)))\n"
"mtxd = mtx.decompose()\n"

View File

@ -21,26 +21,32 @@ void MaterialSet::RegisterMaterialProps(Stream& out) {
"\n";
}
void Material::AddTexture(Stream& out, GX::TexGenSrc type, int mtxIdx, uint32_t texIdx) {
void Material::AddTexture(Stream& out, GX::TexGenSrc type, int mtxIdx, uint32_t texIdx, bool diffuse) {
char mtxLabel[64];
if (mtxIdx == -1)
strncpy(mtxLabel, "IDENTITY", 64);
else
snprintf(mtxLabel, 64, "MTX_%u", mtxIdx);
char texLabel[64];
if (diffuse)
strncpy(texLabel, "Diffuse", 64);
else
strncpy(texLabel, "Texture", 64);
out.format(
"# Texture\n"
"tex_uv_node = new_nodetree.nodes.new('ShaderNodeGeometry')\n"
"tex_uv_node.label = '%s'\n"
"tex_node = new_nodetree.nodes.new('ShaderNodeTexture')\n"
"tex_node.label = 'Texture %u'\n"
"tex_node.label = '%s %u'\n"
"texture_nodes.append(tex_node)\n"
"gridder.place_node(tex_uv_node, 1)\n"
"gridder.place_node(tex_node, 1)\n"
"tex_uv_node.location[0] -= 120\n"
"tex_node.location[0] += 120\n"
"tex_node.location[1] += 176\n",
mtxLabel, texIdx);
mtxLabel, texLabel, texIdx);
if (texIdx != 0xff)
out.format("tex_node.texture = tex_maps[%u]\n", texIdx);
@ -750,6 +756,7 @@ void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupIdx, uns
/* Add texture maps/tcgs */
unsigned addedTcgs = 0;
bool diffuseStage = false;
for (i = 0; i < material.tevStageCount; ++i) {
if (material.tevStageTexInfo[i].tcgSlot != 0xff && !(addedTcgs >> material.tevStageTexInfo[i].tcgSlot & 1)) {
const Material::TexCoordGen& tcg = material.tcgs[material.tevStageTexInfo[i].tcgSlot];
@ -757,14 +764,15 @@ void _ConstructMaterial(Stream& out, const MAT& material, unsigned groupIdx, uns
int mtxIdx = -1;
if (mtx >= GX::TEXMTX0 && mtx <= GX::TEXMTX9)
mtxIdx = (mtx - GX::TEXMTX0) / 3;
Material::AddTexture(out, tcg.source(), mtxIdx, material.tevStageTexInfo[i].texSlot);
Material::AddTexture(out, tcg.source(), mtxIdx, material.tevStageTexInfo[i].texSlot, diffuseStage);
addedTcgs |= 1 << material.tevStageTexInfo[i].tcgSlot;
}
diffuseStage = material.tevStages[i].colorOpOutReg() == GX::TEVREG0;
}
/* Indirect texture node */
if (material.flags.samusReflectionIndirectTexture()) {
Material::AddTexture(out, GX::TexGenSrc::TG_POS, -1, material.indTexSlot[0]);
Material::AddTexture(out, GX::TexGenSrc::TG_POS, -1, material.indTexSlot[0], false);
out << "# Indirect Texture\n"
"ind_out = new_nodetree.nodes.new('ShaderNodeOutput')\n"
"gridder.place_node(ind_out, 3)\n"

View File

@ -459,7 +459,8 @@ struct MaterialSet : BigDNA {
};
Vector<UVAnimation, AT_DNA_COUNT(uvAnimsCount)> uvAnims;
static void AddTexture(hecl::blender::PyOutStream& out, GX::TexGenSrc type, int mtxIdx, uint32_t texIdx);
static void AddTexture(hecl::blender::PyOutStream& out, GX::TexGenSrc type, int mtxIdx, uint32_t texIdx,
bool diffuse);
static void AddTextureAnim(hecl::blender::PyOutStream& out, MaterialSet::Material::UVAnimation::Mode type,
unsigned idx, const float* vals);
static void AddKcolor(hecl::blender::PyOutStream& out, const GX::Color& col, unsigned idx);

View File

@ -193,10 +193,10 @@ void Material::SectionPASS::constructNode(hecl::blender::PyOutStream& out, const
if (uvAnim.size()) {
const UVAnimation& uva = uvAnim[0];
DNAMP1::MaterialSet::Material::AddTexture(out, GX::TexGenSrc(uva.unk1 + (uva.unk1 < 2 ? 0 : 2)), texMtxIdx,
texMapIdx++);
texMapIdx++, false);
DNAMP1::MaterialSet::Material::AddTextureAnim(out, uva.anim.mode, texMtxIdx++, uva.anim.vals);
} else
DNAMP1::MaterialSet::Material::AddTexture(out, GX::TexGenSrc(uvSrc + 4), -1, texMapIdx++);
DNAMP1::MaterialSet::Material::AddTexture(out, GX::TexGenSrc(uvSrc + 4), -1, texMapIdx++, false);
}
/* Special case for RFLV (environment UV mask) */

View File

@ -25,7 +25,7 @@ specter::View* Space::buildSpaceView(specter::ViewResources& res) {
const zeus::CColor* classColor = SpaceMenuNode::LookupClassColor(m_class);
m_spaceSelectButton.reset(new specter::Button(res, tb, &m_spaceSelectBind, "", classIcon,
specter::Button::Style::Block,
classColor ? *classColor : zeus::CColor::skWhite));
classColor ? *classColor : zeus::skWhite));
tb.push_back(m_spaceSelectButton.get(), 0);
buildToolbarView(res, tb);
return m_spaceView.get();

View File

@ -133,7 +133,7 @@ specter::View* ViewManager::BuildSpaceViews() {
specter::RootView* ViewManager::SetupRootView() {
m_rootView.reset(new specter::RootView(*this, m_viewResources, m_mainWindow.get()));
m_rootView->setBackground(zeus::CColor::skBlack);
m_rootView->setBackground(zeus::skBlack);
return m_rootView.get();
}

View File

@ -1420,7 +1420,7 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo
CMapUniverse::CMapUniverseDrawParms parms(universeInterp, x9c_worldIdx, g_GameState->CurrentWorldAssetId(), hexIdx,
x1dc_playerFlashPulse, mgr, planeXf, camXf);
x8_mapu->Draw(parms, zeus::CVector3f::skZero, 0.f, 0.f);
x8_mapu->Draw(parms, zeus::skZero3f, 0.f, 0.f);
}
if (!IsInMapperState(EAutoMapperState::MapScreenUniverse)) {
@ -1467,7 +1467,7 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo
const CMapArea* mapa = mw->GetMapArea(loc.xc_areaId);
if (!mapa)
continue;
zeus::CTransform camRot(camXf.buildMatrix3f(), zeus::CVector3f::skZero);
zeus::CTransform camRot(camXf.buildMatrix3f(), zeus::skZero3f);
CGraphics::SetModelMatrix(
mapXf * zeus::CTransform::Translate(mapa->GetAreaPostTransform(*x24_world, loc.xc_areaId).origin) *
zeus::CTransform::Translate(mapa->GetAreaCenterPoint()) * zeus::CTransform::Scale(objectScale) * camRot);
@ -1484,7 +1484,7 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo
} else
alpha *= xa8_renderStates[0].x34_alphaSurfaceVisited;
alpha *= mapAlpha;
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = alpha;
filter.drawVerts(color, verts);
}
@ -1510,7 +1510,7 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo
}
}
CGraphics::SetDepthRange(DEPTH_NEAR, DEPTH_NEAR);
CGuiWidgetDrawParms parms(frmeAlpha, zeus::CVector3f::skZero);
CGuiWidgetDrawParms parms(frmeAlpha, zeus::skZero3f);
x28_frmeMapScreen->Draw(parms);
CGraphics::SetDepthRange(DEPTH_NEAR, DEPTH_HUD);
}

View File

@ -164,7 +164,7 @@ const zeus::CVector3f& CMapArea::GetAreaPostTranslate(const IWorld& world, TArea
if (world.IGetWorldAssetId() == g_ResFactory->TranslateOriginalToNew(0xB1AC4D65)) // Phazon Mines
return MinesPostTransforms[MinesPostTransformIndices[aid]];
else
return zeus::CVector3f::skZero;
return zeus::skZero3f;
}
CMapArea::CMapAreaSurface::CMapAreaSurface(const void* surfBuf) {

View File

@ -28,9 +28,9 @@ CMapUniverse::CMapWorldData::CMapWorldData(CInputStream& in, u32 version)
else
x54_surfColorSelected.fromRGBA32(255 | (u32(x10_worldAssetId.Value()) & 0xFFFFFF00));
x58_outlineColorSelected = zeus::CColor::lerp(zeus::CColor::skWhite, x54_surfColorSelected, 0.5f);
x5c_surfColorUnselected = zeus::CColor::lerp(zeus::CColor::skBlack, x54_surfColorSelected, 0.5f);
x60_outlineColorUnselected = zeus::CColor::lerp(zeus::CColor::skWhite, x5c_surfColorUnselected, 0.5f);
x58_outlineColorSelected = zeus::CColor::lerp(zeus::skWhite, x54_surfColorSelected, 0.5f);
x5c_surfColorUnselected = zeus::CColor::lerp(zeus::skBlack, x54_surfColorSelected, 0.5f);
x60_outlineColorUnselected = zeus::CColor::lerp(zeus::skWhite, x5c_surfColorUnselected, 0.5f);
for (const zeus::CTransform& xf : x44_hexagonXfs)
x64_centerPoint += xf.origin;

View File

@ -77,7 +77,7 @@ public:
zeus::CColor x58_outlineColorSelected = zeus::CColor(1.0f, 0.0f, 1.0f);
zeus::CColor x5c_surfColorUnselected = zeus::CColor(1.0f, 0.0f, 1.0f);
zeus::CColor x60_outlineColorUnselected = zeus::CColor(1.0f, 0.0f, 1.0f);
zeus::CVector3f x64_centerPoint = zeus::CVector3f::skZero;
zeus::CVector3f x64_centerPoint = zeus::skZero3f;
public:
CMapWorldData(CInputStream& in, u32 version);
@ -97,7 +97,7 @@ private:
CAssetId x0_hexagonId;
TLockedToken<CMapArea> x4_hexagonToken;
std::vector<CMapWorldData> x10_worldDatas;
zeus::CVector3f x20_universeCenter = zeus::CVector3f::skZero;
zeus::CVector3f x20_universeCenter = zeus::skZero3f;
float x2c_universeRadius = 1600.f;
public:

View File

@ -259,7 +259,7 @@ void CMapWorld::DrawAreas(const CMapWorld::CMapWorldDrawParms& parms, int selAre
}
zeus::CColor hintFlashColor =
zeus::CColor::lerp(zeus::CColor::skClear, zeus::CColor{1.f, 1.f, 1.f, 0.f}, parms.GetHintAreaFlashIntensity());
zeus::CColor::lerp(zeus::skClear, zeus::CColor{1.f, 1.f, 1.f, 0.f}, parms.GetHintAreaFlashIntensity());
zeus::CColor finalSurfColor, finalOutlineColor;
if (thisArea == selArea && inMapScreen) {

View File

@ -6,7 +6,7 @@
#include "Graphics/CTexture.hpp"
namespace urde {
const zeus::CVector3f CMappableObject::skDoorVerts[8] = {};
zeus::CVector3f CMappableObject::skDoorVerts[8] = {};
static const u32 DoorIndices[] = {6, 4, 2, 0, 3, 1, 7, 5, 1, 0, 5, 4, 7, 6, 3, 2, 3, 2, 1, 0, 5, 4, 7, 6};
@ -94,7 +94,7 @@ std::pair<zeus::CColor, zeus::CColor> CMappableObject::GetDoorColors(int curArea
} else if (mwInfo.IsDoorVisited(x8_objId)) {
color = g_tweakAutoMapper->GetOpenDoorColor();
} else {
color = zeus::CColor::skClear;
color = zeus::skClear;
}
color.a() *= alpha;
@ -121,7 +121,7 @@ void CMappableObject::Draw(int curArea, const CMapWorldInfo& mwInfo, float alpha
}
} else {
CAssetId iconRes;
zeus::CColor iconColor = zeus::CColor::skWhite;
zeus::CColor iconColor = zeus::skWhite;
switch (x0_type) {
case EMappableObjectType::DownArrowYellow:
iconRes = g_tweakPlayerRes->x10_minesBreakFirstTopIcon;
@ -193,7 +193,7 @@ zeus::CVector3f CMappableObject::BuildSurfaceCenterPoint(int surfIdx) const {
switch (surfIdx) {
case 0:
return x10_transform * zeus::CVector3f::skZero;
return x10_transform * zeus::skZero3f;
case 1:
return x10_transform * zeus::CVector3f{0.f, 0.f, 2.f * doorCenter.x()};
case 2:
@ -235,7 +235,7 @@ boo::ObjToken<boo::IGraphicsBufferS> CMappableObject::g_doorIbo;
void CMappableObject::ReadAutoMapperTweaks(const ITweakAutoMapper& tweaks) {
const zeus::CVector3f& center = tweaks.GetDoorCenter();
zeus::simd_floats centerF(center.mSimd);
zeus::CVector3f* doorVerts = const_cast<zeus::CVector3f*>(&CMappableObject::skDoorVerts[0]);
zeus::CVector3f* doorVerts = CMappableObject::skDoorVerts;
/* Wrap door verts around -Z to build surface */
doorVerts[0].assign(-centerF[2], -centerF[1], 0.f);
doorVerts[1].assign(-centerF[2], -centerF[1], 2.f * centerF[0]);

View File

@ -49,7 +49,7 @@ public:
enum class EVisMode { Always, MapStationOrVisit, Visit, Never, MapStationOrVisit2 };
private:
static const zeus::CVector3f skDoorVerts[8];
static zeus::CVector3f skDoorVerts[8];
EMappableObjectType x0_type;
EVisMode x4_visibilityMode;

View File

@ -6,6 +6,7 @@
#include "Camera/CFirstPersonCamera.hpp"
#include "CMemoryCardSys.hpp"
#include "GameGlobalObjects.hpp"
#include "TCastTo.hpp"
namespace urde {
const u32 CPlayerState::PowerUpMaxValues[41] = {1, 1, 1, 1, 250, 1, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -186,7 +187,7 @@ bool CPlayerState::CanVisorSeeFog(const CStateManager& stateMgr) const {
CPlayerState::EPlayerVisor CPlayerState::GetActiveVisor(const CStateManager& stateMgr) const {
const CFirstPersonCamera* cam =
static_cast<const CFirstPersonCamera*>(stateMgr.GetCameraManager()->GetCurrentCamera(stateMgr));
TCastToConstPtr<CFirstPersonCamera>(stateMgr.GetCameraManager()->GetCurrentCamera(stateMgr)).GetPtr();
return (cam ? x14_currentVisor : EPlayerVisor::Combat);
}
@ -235,9 +236,10 @@ void CPlayerState::UpdateVisorTransition(float dt) {
}
}
bool CPlayerState::StartVisorTransition(CPlayerState::EPlayerVisor visor) {
void CPlayerState::StartTransitionToVisor(CPlayerState::EPlayerVisor visor) {
if (x18_transitioningVisor == visor)
return;
x18_transitioningVisor = visor;
return x14_currentVisor == x18_transitioningVisor;
}
void CPlayerState::ResetVisor() {

View File

@ -145,7 +145,7 @@ public:
bool GetIsVisorTransitioning() const;
float GetVisorTransitionFactor() const;
void UpdateVisorTransition(float dt);
bool StartVisorTransition(EPlayerVisor visor);
void StartTransitionToVisor(EPlayerVisor visor);
void ResetVisor();
bool ItemEnabled(EItemType type) const;
void DisableItem(EItemType type);

View File

@ -18,7 +18,7 @@ class CActor;
class CSortedListManager {
struct SNode {
const CActor* x0_actor = nullptr;
zeus::CAABox x4_box = zeus::CAABox::skNullBox;
zeus::CAABox x4_box = zeus::skNullBox;
s16 x1c_selfIdxs[6] = {-1, -1, -1, -1, -1, -1};
s16 x28_next = -1;
bool x2a_populated = false;

View File

@ -544,7 +544,7 @@ void CStateManager::DrawE3DeathEffect() const {
}
}
float whiteAmt = zeus::clamp(0.f, 1.f - player.x9f4_deathTime / (0.05f * 6.f), 1.f);
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = whiteAmt;
const_cast<CColoredQuadFilter&>(m_deathWhiteout).draw(color);
}
@ -552,7 +552,7 @@ void CStateManager::DrawE3DeathEffect() const {
void CStateManager::DrawAdditionalFilters() const {
if (xf0c_escapeTimer < 1.f && xf0c_escapeTimer > 0.f && !x870_cameraManager->IsInCinematicCamera()) {
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = 1.f - xf0c_escapeTimer;
const_cast<CColoredQuadFilter&>(m_escapeWhiteout).draw(color);
}
@ -596,8 +596,8 @@ zeus::CFrustum CStateManager::SetupViewForDraw(const SViewport& vp) const {
proj.setPersp(zeus::SProjPersp{fov, width / height, cam->GetNearClipDistance(), cam->GetFarClipDistance()});
frustum.updatePlanes(camXf, proj);
g_Renderer->SetClippingPlanes(frustum);
// g_Renderer->PrimColor(zeus::CColor::skWhite);
CGraphics::SetModelMatrix(zeus::CTransform::Identity());
// g_Renderer->PrimColor(zeus::skWhite);
CGraphics::SetModelMatrix(zeus::CTransform());
x87c_fluidPlaneManager->StartFrame(false);
g_Renderer->SetDebugOption(IRenderer::EDebugOption::One, 1);
return frustum;
@ -689,7 +689,7 @@ void CStateManager::DrawWorld() const {
}
if (!SetupFogForDraw())
g_Renderer->SetWorldFog(ERglFogMode::None, 0.f, 1.f, zeus::CColor::skBlack);
g_Renderer->SetWorldFog(ERglFogMode::None, 0.f, 1.f, zeus::skBlack);
x850_world->DrawSky(zeus::CTransform::Translate(CGraphics::g_ViewPoint));
@ -819,7 +819,7 @@ void CStateManager::DrawWorld() const {
x87c_fluidPlaneManager->EndFrame();
g_Renderer->SetWorldFog(ERglFogMode::None, 0.f, 1.f, zeus::CColor::skBlack);
g_Renderer->SetWorldFog(ERglFogMode::None, 0.f, 1.f, zeus::skBlack);
#if 0
if (false)
@ -840,7 +840,7 @@ void CStateManager::DrawWorld() const {
if (thermal) {
g_Renderer->DoThermalBlendHot();
g_Renderer->SetThermal(false, 0.f, zeus::CColor::skBlack);
g_Renderer->SetThermal(false, 0.f, zeus::skBlack);
const_cast<CStateManager&>(*this).xf34_thermalFlag = EThermalDrawFlag::Bypass;
}
@ -896,7 +896,7 @@ void CStateManager::SetupFogForAreaNonCurrent(const CGameArea& area) const {
bool CStateManager::SetupFogForDraw() const {
switch (x8b8_playerState->GetActiveVisor(*this)) {
case CPlayerState::EPlayerVisor::Thermal:
g_Renderer->SetWorldFog(ERglFogMode::None, 0.f, 1.f, zeus::CColor::skBlack);
g_Renderer->SetWorldFog(ERglFogMode::None, 0.f, 1.f, zeus::skBlack);
return true;
case CPlayerState::EPlayerVisor::XRay:
default:
@ -1272,7 +1272,7 @@ void CStateManager::ApplyKnockBack(CActor& actor, const CDamageInfo& info, const
if (physActor->GetMaterialList().HasMaterial(EMaterialTypes::Immovable) ||
!physActor->GetMaterialList().HasMaterial(EMaterialTypes::Grass))
return;
physActor->ApplyImpulseWR(kbVec, zeus::CAxisAngle::sIdentity);
physActor->ApplyImpulseWR(kbVec, zeus::CAxisAngle());
return;
}
}
@ -1303,7 +1303,7 @@ void CStateManager::KnockBackPlayer(CPlayer& player, const zeus::CVector3f& pos,
float maxVel = std::max(playerVel, minVel);
zeus::CVector3f negVel = -player.x138_velocity;
usePower *= (1.f - 0.5f * zeus::CVector3f::getAngleDiff(pos, negVel) / M_PIF);
player.ApplyImpulseWR(pos * usePower, zeus::CAxisAngle::sIdentity);
player.ApplyImpulseWR(pos * usePower, zeus::CAxisAngle());
player.UseCollisionImpulses();
player.x2d4_accelerationChangeTimer = 0.25f;
@ -1515,7 +1515,7 @@ void CStateManager::TestBombHittingWater(const CActor& damager, const zeus::CVec
zeus::CAABox bounds = water->GetTriggerBoundsWR();
zeus::CVector3f hitPos(pos.x(), pos.y(), bounds.max.z());
float bombRad = powerBomb ? 4.f : 2.f;
float delta = bounds.max.z() - pos.dot(zeus::CVector3f::skUp);
float delta = bounds.max.z() - pos.dot(zeus::skUp);
if (delta <= bombRad && delta > 0.f) {
// Below surface
float rippleFactor = 1.f - delta / bombRad;
@ -1532,7 +1532,7 @@ void CStateManager::TestBombHittingWater(const CActor& damager, const zeus::CVec
if (delta <= -bombMag || delta >= 0.f)
return;
CRayCastResult res =
RayStaticIntersection(pos, zeus::CVector3f::skDown, -delta, CMaterialFilter::skPassEverything);
RayStaticIntersection(pos, zeus::skDown, -delta, CMaterialFilter::skPassEverything);
if (res.IsInvalid() && x87c_fluidPlaneManager->GetLastRippleDeltaTime(damager.GetUniqueId()) >= 0.15f) {
// Not blocked by static geometry
float mag = 0.6f * bombMag + 0.4f * bombMag * std::sin(2.f * M_PIF * -delta / bombMag * 0.25f);
@ -1615,7 +1615,7 @@ bool CStateManager::ApplyDamage(TUniqueId damagerId, TUniqueId damageeId, TUniqu
if (damagee) {
if (CHealthInfo* hInfo = damagee->HealthInfo(*this)) {
zeus::CVector3f position;
zeus::CVector3f direction = zeus::CVector3f::skRight;
zeus::CVector3f direction = zeus::skRight;
bool alive = hInfo->GetHP() > 0.f;
if (damager) {
position = damager->GetTranslation();

View File

@ -138,8 +138,8 @@ void CBallCamera::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CSt
colAct->SetTranslation(GetTranslation());
stateMgr.AddObject(colAct);
colAct->SetMovable(false);
CMotionState mState(GetTranslation(), zeus::CNUQuaternion::fromAxisAngle(zeus::CVector3f::skForward, 0.f),
zeus::CVector3f::skZero, zeus::CAxisAngle::sIdentity);
CMotionState mState(GetTranslation(), zeus::CNUQuaternion::fromAxisAngle(zeus::skForward, 0.f),
zeus::skZero3f, zeus::CAxisAngle());
colAct->SetLastNonCollidingState(mState);
SetMaterialFilter(CMaterialFilter::MakeIncludeExclude(
{}, {EMaterialTypes::Solid, EMaterialTypes::ProjectilePassthrough, EMaterialTypes::Player,
@ -212,15 +212,15 @@ void CBallCamera::Reset(const zeus::CTransform& xf, CStateManager& mgr) {
x2e8_ballVelFlat = 0.f;
x2ec_maxBallVel = 0.f;
x190_curMinDistance = x194_targetMinDistance;
x2fc_ballDeltaFlat = zeus::CVector3f::skZero;
x2f0_ballDelta = zeus::CVector3f::skZero;
x2fc_ballDeltaFlat = zeus::skZero3f;
x2f0_ballDelta = zeus::skZero3f;
x18d_28_obtuseDirection = false;
x308_speedFactor = 0.f;
x2dc_prevBallPos = player->GetBallPosition();
x294_dampedPos = GetTranslation();
x2a0_smallCentroid = zeus::CVector3f::skZero;
x2ac_mediumCentroid = zeus::CVector3f::skZero;
x2b8_largeCentroid = zeus::CVector3f::skZero;
x2a0_smallCentroid = zeus::skZero3f;
x2ac_mediumCentroid = zeus::skZero3f;
x2b8_largeCentroid = zeus::skZero3f;
x2c4_smallCollidersObsCount = 0;
x2c8_mediumCollidersObsCount = 0;
x2cc_largeCollidersObsCount = 0;
@ -278,27 +278,27 @@ void CBallCamera::BuildSplineNav(CStateManager& mgr) {
TUniqueId intersectId = kInvalidUniqueId;
rstl::reserved_vector<TUniqueId, 1024> nearList;
CRayCastResult result =
mgr.RayWorldIntersection(intersectId, ballPos, zeus::CVector3f::skDown, 20.f, BallCameraFilter, nearList);
mgr.RayWorldIntersection(intersectId, ballPos, zeus::skDown, 20.f, BallCameraFilter, nearList);
float downFactor = result.IsValid() ? zeus::clamp(0.f, result.GetT() / 20.f, 1.f) : 1.f;
x36c_splineState = ESplineState::Nav;
x370_24_reevalSplineEnd = true;
x3d0_24_camBehindFloorOrWall = false;
x37c_camSpline.Reset(4);
x37c_camSpline.AddKnot(GetTranslation(), zeus::CVector3f::skForward);
x37c_camSpline.AddKnot(GetTranslation(), zeus::skForward);
float elevation = x1a0_elevation;
float distance = x190_curMinDistance;
ConstrainElevationAndDistance(elevation, distance, 0.f, mgr);
zeus::CVector3f pt1(x35c_splineIntermediatePos.x(), x35c_splineIntermediatePos.y(), GetTranslation().z());
x37c_camSpline.AddKnot(pt1, zeus::CVector3f::skForward);
x37c_camSpline.AddKnot(pt1, zeus::skForward);
zeus::CVector3f pt2 = pt1 + (x35c_splineIntermediatePos - GetTranslation()) * (0.5f + downFactor);
x37c_camSpline.AddKnot(pt2, zeus::CVector3f::skForward);
x37c_camSpline.AddKnot(pt2, zeus::skForward);
zeus::CVector3f pt2Ball = ballPos - pt2;
if (pt2Ball.canBeNormalized())
pt2Ball.normalize();
else
pt2Ball = mgr.GetPlayer().GetMoveDir();
zeus::CVector3f desiredPosition = FindDesiredPosition(distance, elevation, pt2Ball, mgr, false);
x37c_camSpline.AddKnot(desiredPosition, zeus::CVector3f::skForward);
x37c_camSpline.AddKnot(desiredPosition, zeus::skForward);
x37c_camSpline.UpdateSplineLength();
x3d0_24_camBehindFloorOrWall = false;
CMaterialList intersectMat;
@ -318,7 +318,7 @@ void CBallCamera::BuildSplineArc(CStateManager& mgr) {
x36c_splineState = ESplineState::Arc;
x370_24_reevalSplineEnd = false;
x37c_camSpline.Reset(4);
x37c_camSpline.AddKnot(GetTranslation(), zeus::CVector3f::skForward);
x37c_camSpline.AddKnot(GetTranslation(), zeus::skForward);
float elevation = x1a0_elevation;
float distance = x190_curMinDistance;
ConstrainElevationAndDistance(elevation, distance, 0.f, mgr);
@ -341,7 +341,7 @@ void CBallCamera::BuildSplineArc(CStateManager& mgr) {
pt1 = delta.normalized() * 1.5f + result.GetPoint();
else
pt1 = halfwayPoint + delta;
x37c_camSpline.AddKnot(pt1, zeus::CVector3f::skForward);
x37c_camSpline.AddKnot(pt1, zeus::skForward);
FindDesiredPosition(distance, elevation, mgr.GetPlayer().GetMoveDir(), mgr, false);
delta = rot.transform(delta);
zeus::CVector3f pt2 = halfwayPoint + delta;
@ -351,7 +351,7 @@ void CBallCamera::BuildSplineArc(CStateManager& mgr) {
pt2 = delta.normalized() * 2.f + result.GetPoint();
else
pt2 = halfwayPoint + delta;
x37c_camSpline.AddKnot(pt2, zeus::CVector3f::skForward);
x37c_camSpline.AddKnot(pt2, zeus::skForward);
delta = rot.transform(delta);
zeus::CVector3f pt3 = delta + halfwayPoint;
result =
@ -360,7 +360,7 @@ void CBallCamera::BuildSplineArc(CStateManager& mgr) {
pt3 = delta.normalized() * 2.f + result.GetPoint();
else
pt3 = halfwayPoint + delta;
x37c_camSpline.AddKnot(pt3, zeus::CVector3f::skForward);
x37c_camSpline.AddKnot(pt3, zeus::skForward);
CMaterialList intersectMat;
if (!SplineIntersectTest(intersectMat, mgr) && intersectMat.HasMaterial(EMaterialTypes::Wall)) {
delta = pt1 - halfwayPoint;
@ -451,7 +451,7 @@ void CBallCamera::UpdateTransform(const zeus::CVector3f& lookDir, const zeus::CV
} else {
float angleSpeedMul = zeus::clamp(0.f, std::acos(lookDirDot) / (zeus::degToRad(60.f) * dt), 1.f);
float angleDelta = dt * x1a4_curAnglePerSecond * angleSpeedMul;
float lookUpDot = std::fabs(zeus::clamp(-1.f, useLookDir.dot(zeus::CVector3f::skUp), 1.f));
float lookUpDot = std::fabs(zeus::clamp(-1.f, useLookDir.dot(zeus::skUp), 1.f));
float maxAngleDelta = (1.f - lookUpDot) * zeus::degToRad(720.f) * dt;
if (x36c_splineState == ESplineState::Nav) {
maxAngleDelta = zeus::degToRad(240.f) * dt;
@ -622,8 +622,8 @@ zeus::CVector3f CBallCamera::GetFixedLookTarget(const zeus::CVector3f& hintToLoo
hintDir.normalize();
hintDirFlat.normalize();
} else {
hintDir = zeus::CVector3f::skForward;
hintDirFlat = zeus::CVector3f::skForward;
hintDir = zeus::skForward;
hintDirFlat = zeus::skForward;
}
zeus::CVector3f hintToLookDirFlat = hintToLookDir;
@ -848,7 +848,7 @@ zeus::CVector3f CBallCamera::InterpolateCameraElevation(const zeus::CVector3f& c
zeus::CVector3f CBallCamera::CalculateCollidersCentroid(const std::vector<CCameraCollider>& colliderList,
int numObscured) const {
if (colliderList.size() < 3)
return zeus::CVector3f::skForward;
return zeus::skForward;
int clearColliders = 0;
const CCameraCollider* prevCol = &colliderList.back();
@ -873,7 +873,7 @@ zeus::CVector3f CBallCamera::CalculateCollidersCentroid(const std::vector<CCamer
}
if (clearColliders / float(colliderList.size()) <= x330_clearColliderThreshold) {
return zeus::CVector3f::skForward;
return zeus::skForward;
} else if (0.f != accumCross) {
float baryCross = 3.f * accumCross;
return {accumX / baryCross, 0.f, accumZ / baryCross};
@ -890,7 +890,7 @@ zeus::CVector3f CBallCamera::ApplyColliders() {
if (smallCentroid.y() == 0.f)
x2a0_smallCentroid = smallCentroid;
else
x2a0_smallCentroid = zeus::CVector3f::skZero;
x2a0_smallCentroid = zeus::skZero3f;
float centroidX = x2a0_smallCentroid.x();
float centroidZ = x2a0_smallCentroid.z();
@ -898,7 +898,7 @@ zeus::CVector3f CBallCamera::ApplyColliders() {
if (mediumCentroid.y() == 0.f)
x2ac_mediumCentroid = mediumCentroid;
else
x2ac_mediumCentroid = zeus::CVector3f::skZero;
x2ac_mediumCentroid = zeus::skZero3f;
centroidX += x2ac_mediumCentroid.x();
centroidZ += x2ac_mediumCentroid.z();
@ -906,7 +906,7 @@ zeus::CVector3f CBallCamera::ApplyColliders() {
if (largeCentroid.y() == 0.f)
x2b8_largeCentroid = largeCentroid;
else
x2b8_largeCentroid = zeus::CVector3f::skZero;
x2b8_largeCentroid = zeus::skZero3f;
centroidX += x2b8_largeCentroid.x();
centroidZ += x2b8_largeCentroid.z();
@ -927,7 +927,7 @@ zeus::CVector3f CBallCamera::ApplyColliders() {
}
if (!x18c_28_volumeCollider)
return zeus::CVector3f::skZero;
return zeus::skZero3f;
if (std::fabs(centroidX) < 0.05f)
centroidX = 0.f;
@ -1224,7 +1224,7 @@ void CBallCamera::UpdateUsingColliders(float dt, CStateManager& mgr) {
colliderPointLocal = colliderPointLocal * x308_speedFactor;
}
if (d < 1.f)
colliderPointLocal = zeus::CVector3f::skZero;
colliderPointLocal = zeus::skZero3f;
}
zeus::CVector3f camDelta = lookXf.rotate(colliderPointLocal) + desiredCamPos - ballPos;
@ -1379,7 +1379,7 @@ void CBallCamera::UpdateUsingTransitions(float dt, CStateManager& mgr) {
SetTransform(zeus::CQuaternion::lookAt(xe8.basis[1], camToLookDir, devAngle).toTransform() *
xe8.getRotation());
else
SetTransform(zeus::lookAt(zeus::CVector3f::skZero, camToLookDir));
SetTransform(zeus::lookAt(zeus::skZero3f, camToLookDir));
}
}
SetTransform(ValidateCameraTransform(x34_transform, xe8));
@ -1613,9 +1613,9 @@ zeus::CVector3f CBallCamera::FindDesiredPosition(float distance, float elevation
zeus::CVector3f useDir = dir;
if (!dir.canBeNormalized())
useDir = zeus::CVector3f::skForward;
useDir = zeus::skForward;
zeus::CTransform lookDirXf = zeus::lookAt(zeus::CVector3f::skZero, useDir);
zeus::CTransform lookDirXf = zeus::lookAt(zeus::skZero3f, useDir);
zeus::CVector3f ballPos = player->GetBallPosition();
float elev = elevation;
float dist = distance;
@ -1763,7 +1763,7 @@ bool CBallCamera::DetectCollision(const zeus::CVector3f& from, const zeus::CVect
CGameCollision::BuildAreaCollisionCache(mgr, cache);
if (cache.HasCacheOverflowed())
clear = false;
CCollidableSphere cSphere({zeus::CVector3f::skZero, radius}, {EMaterialTypes::Solid});
CCollidableSphere cSphere({zeus::skZero3f, radius}, {EMaterialTypes::Solid});
if (CGameCollision::DetectCollisionBoolean_Cached(
mgr, cache, cSphere, zeus::CTransform::Translate(from),
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid},
@ -1881,7 +1881,7 @@ bool CBallCamera::CheckTransitionLineOfSight(const zeus::CVector3f& eyePos, cons
CCollisionInfo cinfo;
double d = eyeToBehindMag;
TUniqueId intersectId = kInvalidUniqueId;
CCollidableSphere cSphere({zeus::CVector3f::skZero, colRadius}, {EMaterialTypes::Solid});
CCollidableSphere cSphere({zeus::skZero3f, colRadius}, {EMaterialTypes::Solid});
if (CGameCollision::DetectCollision_Cached_Moving(
mgr, cache, cSphere, zeus::CTransform::Translate(eyePos),
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid},
@ -2052,7 +2052,7 @@ void CBallCamera::UpdateLookAtPosition(float dt, CStateManager& mgr) {
zeus::CTransform CBallCamera::UpdateLookDirection(const zeus::CVector3f& dir, CStateManager& mgr) {
zeus::CVector3f useDir = dir;
if (!dir.canBeNormalized())
useDir = zeus::CVector3f::skForward;
useDir = zeus::skForward;
float elevation = x1a0_elevation;
float distance = x190_curMinDistance;
ConstrainElevationAndDistance(elevation, distance, 0.f, mgr);

View File

@ -114,9 +114,9 @@ private:
std::vector<CCameraCollider> x274_mediumColliders;
std::vector<CCameraCollider> x284_largeColliders;
zeus::CVector3f x294_dampedPos;
zeus::CVector3f x2a0_smallCentroid = zeus::CVector3f::skUp;
zeus::CVector3f x2ac_mediumCentroid = zeus::CVector3f::skUp;
zeus::CVector3f x2b8_largeCentroid = zeus::CVector3f::skUp;
zeus::CVector3f x2a0_smallCentroid = zeus::skUp;
zeus::CVector3f x2ac_mediumCentroid = zeus::skUp;
zeus::CVector3f x2b8_largeCentroid = zeus::skUp;
int x2c4_smallCollidersObsCount = 0;
int x2c8_mediumCollidersObsCount = 0;
int x2cc_largeCollidersObsCount = 0;
@ -135,7 +135,7 @@ private:
u32 x328_avoidGeomCycle = 0;
float x32c_colliderMag = 1.f;
float x330_clearColliderThreshold = 0.2f;
zeus::CAABox x334_collidersAABB = zeus::CAABox::skNullBox;
zeus::CAABox x334_collidersAABB = zeus::skNullBox;
float x34c_obscuredTime = 0.f;
CMaterialList x350_obscuringMaterial = {EMaterialTypes::NoStepLogic};
float x358_unobscureMag = 0.f;

View File

@ -71,13 +71,13 @@ void CCameraFilterPass<S>::SetFilter(EFilterType type, EFilterShape shape, float
x4_nextType = type;
if (type == EFilterType::Passthru) {
if (x0_curType == EFilterType::Multiply)
x1c_nextColor = zeus::CColor::skWhite;
x1c_nextColor = zeus::skWhite;
else if (x0_curType == EFilterType::Add || x0_curType == EFilterType::Blend)
x1c_nextColor.a() = 0.f;
} else {
if (x0_curType == EFilterType::Passthru) {
if (type == EFilterType::Multiply) {
x18_curColor = zeus::CColor::skWhite;
x18_curColor = zeus::skWhite;
} else if (type == EFilterType::Add || type == EFilterType::Blend) {
x18_curColor = x1c_nextColor;
x18_curColor.a() = 0.f;
@ -96,7 +96,7 @@ void CCameraFilterPass<S>::SetFilter(EFilterType type, EFilterShape shape, float
template <class S>
void CCameraFilterPass<S>::DisableFilter(float time) {
SetFilter(EFilterType::Passthru, x8_shape, time, zeus::CColor::skWhite, -1);
SetFilter(EFilterType::Passthru, x8_shape, time, zeus::skWhite, -1);
}
template <class S>

View File

@ -22,7 +22,7 @@ float CCameraManager::sFirstPersonFOV = 55.f;
float CCameraManager::sThirdPersonFOV = 60.f;
CCameraManager::CCameraManager(TUniqueId curCameraId) : x0_curCameraId(curCameraId) {
CSfxManager::AddListener(CSfxManager::ESfxChannels::Game, zeus::CVector3f::skZero, zeus::CVector3f::skZero,
CSfxManager::AddListener(CSfxManager::ESfxChannels::Game, zeus::skZero3f, zeus::skZero3f,
{1.f, 0.f, 0.f}, {0.f, 0.f, 1.f}, 50.f, 50.f, 1000.f, 1, 1.f);
sFirstPersonFOV = g_tweakGame->GetFirstPersonFOV();
}
@ -58,7 +58,7 @@ int CCameraManager::AddCameraShaker(const CCameraShakeData& data, bool sfx) {
float vol = zeus::clamp(100.f, std::max(data.GetMaxAMComponent(), data.GetMaxFMComponent()) * 9.f + 100.f, 127.f);
CSfxHandle sfxHandle;
if (data.xc0_flags & 0x1)
sfxHandle = CSfxManager::AddEmitter(SFXamb_x_rumble_lp_00, data.xc4_sfxPos, zeus::CVector3f::skZero, vol / 127.f,
sfxHandle = CSfxManager::AddEmitter(SFXamb_x_rumble_lp_00, data.xc4_sfxPos, zeus::skZero3f, vol / 127.f,
false, false, 0x7f, kInvalidAreaId);
else
sfxHandle = CSfxManager::SfxStart(SFXamb_x_rumble_lp_00, vol / 127.f, 0.f, false, 0x7f, false, kInvalidAreaId);
@ -134,17 +134,17 @@ const CGameCamera* CCameraManager::GetCurrentCamera(const CStateManager& stateMg
void CCameraManager::CreateStandardCameras(CStateManager& stateMgr) {
TUniqueId fpId = stateMgr.AllocateUniqueId();
x7c_fpCamera =
new CFirstPersonCamera(fpId, zeus::CTransform::Identity(), stateMgr.Player()->GetUniqueId(),
new CFirstPersonCamera(fpId, zeus::CTransform(), stateMgr.Player()->GetUniqueId(),
g_tweakPlayer->GetOrbitCameraSpeed(), sFirstPersonFOV, sNearPlane, sFarPlane, sAspect);
stateMgr.AddObject(x7c_fpCamera);
stateMgr.Player()->SetCameraState(CPlayer::EPlayerCameraState::FirstPerson, stateMgr);
SetCurrentCameraId(fpId, stateMgr);
x80_ballCamera = new CBallCamera(stateMgr.AllocateUniqueId(), stateMgr.Player()->GetUniqueId(),
zeus::CTransform::Identity(), sThirdPersonFOV, sNearPlane, sFarPlane, sAspect);
zeus::CTransform(), sThirdPersonFOV, sNearPlane, sFarPlane, sAspect);
stateMgr.AddObject(x80_ballCamera);
x88_interpCamera = new CInterpolationCamera(stateMgr.AllocateUniqueId(), zeus::CTransform::Identity());
x88_interpCamera = new CInterpolationCamera(stateMgr.AllocateUniqueId(), zeus::CTransform());
stateMgr.AddObject(x88_interpCamera);
}
@ -500,7 +500,7 @@ void CCameraManager::UpdateFog(float dt, CStateManager& mgr) {
}
void CCameraManager::UpdateRumble(float dt, CStateManager& mgr) {
x30_shakeOffset = zeus::CVector3f::skZero;
x30_shakeOffset = zeus::skZero3f;
for (auto it = x14_shakers.begin(); it != x14_shakers.end();) {
CCameraShakeData& shaker = *it;
shaker.Update(dt, mgr);
@ -525,12 +525,12 @@ void CCameraManager::UpdateRumble(float dt, CStateManager& mgr) {
}
if (mgr.GetPlayer().GetCameraState() != CPlayer::EPlayerCameraState::FirstPerson && !IsInCinematicCamera())
x30_shakeOffset = zeus::CVector3f::skZero;
x30_shakeOffset = zeus::skZero3f;
}
void CCameraManager::UpdateListener(CStateManager& mgr) {
const zeus::CTransform xf = GetCurrentCameraTransform(mgr);
CSfxManager::UpdateListener(xf.origin, zeus::CVector3f::skZero, xf.frontVector(), xf.upVector(), 1.f);
CSfxManager::UpdateListener(xf.origin, zeus::skZero3f, xf.frontVector(), xf.upVector(), 1.f);
}
float CCameraManager::CalculateFogDensity(CStateManager& mgr, const CScriptWater* water) {
@ -600,7 +600,7 @@ void CCameraManager::SetPlayerCamera(CStateManager& mgr, TUniqueId newCamId) {
float CCameraManager::GetCameraBobMagnitude() const {
return 1.f - zeus::clamp(
-1.f,
std::fabs(zeus::clamp(-1.f, x7c_fpCamera->GetTransform().basis[1].dot(zeus::CVector3f::skUp), 1.f)) /
std::fabs(zeus::clamp(-1.f, x7c_fpCamera->GetTransform().basis[1].dot(zeus::skUp), 1.f)) /
std::cos(2.f * M_PIF / 12.f),
1.f);
}

View File

@ -33,7 +33,7 @@ CCameraShakeData::CCameraShakeData(float duration, float sfxDist, u32 flags, con
, xd0_sfxDist(sfxDist) {}
CCameraShakeData::CCameraShakeData(float duration, float magnitude)
: CCameraShakeData(duration, 100.f, 0, zeus::CVector3f::skZero, CCameraShakerComponent{}, CCameraShakerComponent{},
: CCameraShakeData(duration, 100.f, 0, zeus::skZero3f, CCameraShakerComponent{}, CCameraShakerComponent{},
CCameraShakerComponent{1, SCameraShakePoint{0, 0.25f * duration, 0.f, 0.75f * duration, magnitude},
SCameraShakePoint{1, 0.f, 0.f, 0.5f * duration, 2.f}}) {}
@ -53,7 +53,7 @@ CCameraShakeData CCameraShakeData::BuildLandingCameraShakeData(float duration, f
return {duration,
100.f,
0,
zeus::CVector3f::skZero,
zeus::skZero3f,
CCameraShakerComponent(1, SCameraShakePoint(0, 0.15f * duration, 0.f, 0.85f * duration, magnitude),
SCameraShakePoint(1, 0.f, 0.f, 0.4f * duration, 1.5f)),
CCameraShakerComponent(),
@ -65,7 +65,7 @@ CCameraShakeData CCameraShakeData::BuildProjectileCameraShake(float duration, fl
return {duration,
100.f,
0,
zeus::CVector3f::skZero,
zeus::skZero3f,
CCameraShakerComponent(1, SCameraShakePoint(0, 0.f, 0.f, duration, magnitude),
SCameraShakePoint(1, 0.f, 0.f, 0.5f * duration, 3.f)),
CCameraShakerComponent(),
@ -83,7 +83,7 @@ CCameraShakeData CCameraShakeData::BuildPhazonCameraShakeData(float duration, fl
return {duration,
100.f,
0,
zeus::CVector3f::skZero,
zeus::skZero3f,
CCameraShakerComponent(1, SCameraShakePoint(0, 0.15f * duration, 0.f, 0.25f * duration, magnitude),
SCameraShakePoint(1, 0.f, 0.f, 0.4f * duration, 0.3f)),
CCameraShakerComponent(),
@ -95,7 +95,7 @@ CCameraShakeData CCameraShakeData::BuildPatternedExplodeShakeData(float duration
return {duration,
100.f,
0,
zeus::CVector3f::skZero,
zeus::skZero3f,
CCameraShakerComponent(1, SCameraShakePoint(0, 0.25f * duration, 0.f, 0.75f * duration, magnitude),
SCameraShakePoint(1, 0.f, 0.f, 0.5f * duration, 2.0f)),
CCameraShakerComponent(),
@ -188,14 +188,14 @@ CCameraShakeData CCameraShakeData::LoadCameraShakeData(CInputStream& in) {
CCameraShakerComponent shakerY;
CCameraShakerComponent shakerZ(1, zAM, zFM);
return {duration, 100.f, 0, zeus::CVector3f::skZero, shakerX, shakerY, shakerZ};
return {duration, 100.f, 0, zeus::skZero3f, shakerX, shakerY, shakerZ};
}
const CCameraShakeData CCameraShakeData::skChargedShotCameraShakeData = {
0.3f,
100.f,
0,
zeus::CVector3f::skZero,
zeus::skZero3f,
CCameraShakerComponent(),
CCameraShakerComponent(1, {0, 0.f, 0.f, 0.3f, -1.f}, {1, 0.f, 0.f, 0.05f, 0.3f}),
CCameraShakerComponent()};

View File

@ -72,7 +72,7 @@ void CCameraSpline::SetKnotPosition(int idx, const zeus::CVector3f& pos) {
const zeus::CVector3f& CCameraSpline::GetKnotPosition(int idx) const {
if (idx >= x4_positions.size())
return zeus::CVector3f::skZero;
return zeus::skZero3f;
return x4_positions[idx];
}
@ -211,12 +211,12 @@ zeus::CTransform CCameraSpline::GetInterpolatedSplinePointByLength(float pos) co
if (GetSurroundingPoints(baseIdx, positions, directions)) {
float f1 = zeus::clamp(-1.f, directions[1].dot(directions[2]), 1.f);
if (f1 >= 1.f) {
zeus::CTransform ret = zeus::lookAt(zeus::CVector3f::skZero, directions[2]);
zeus::CTransform ret = zeus::lookAt(zeus::skZero3f, directions[2]);
ret.origin = zeus::getCatmullRomSplinePoint(positions[0], positions[1], positions[2], positions[3], t);
return ret;
} else {
zeus::CTransform ret = zeus::lookAt(
zeus::CVector3f::skZero,
zeus::skZero3f,
zeus::CQuaternion::lookAt(directions[1], directions[2], std::acos(f1) * t).transform(directions[1]));
ret.origin = zeus::getCatmullRomSplinePoint(positions[0], positions[1], positions[2], positions[3], t);
return ret;

View File

@ -159,7 +159,7 @@ void CCinematicCamera::Think(float dt, CStateManager& mgr) {
x1f8_passedTarget = idx;
SendArrivedMsg(x1c8_targetArrivals[x1f8_passedTarget], mgr);
}
zeus::CVector3f upVec = orientation.transform(zeus::CVector3f::skUp);
zeus::CVector3f upVec = orientation.transform(zeus::skUp);
if ((target - viewPoint).toVec2f().magnitude() < 0.0011920929f)
SetTranslation(target);
else
@ -174,7 +174,7 @@ void CCinematicCamera::Think(float dt, CStateManager& mgr) {
else
target.z() += mgr.GetPlayer().GetEyeHeight();
zeus::CVector3f upVec = orientation.transform(zeus::CVector3f::skUp);
zeus::CVector3f upVec = orientation.transform(zeus::skUp);
if ((target - viewPoint).toVec2f().magnitude() < 0.0011920929f)
SetTranslation(target);
else

View File

@ -62,7 +62,7 @@ void CFirstPersonCamera::Reset(const zeus::CTransform& xf, CStateManager& mgr) {
}
void CFirstPersonCamera::SkipCinematic() {
x1c8_closeInVec = zeus::CVector3f::skZero;
x1c8_closeInVec = zeus::skZero3f;
x1d4_closeInTimer = 0.f;
}
@ -92,7 +92,7 @@ void CFirstPersonCamera::CalculateGunFollowOrientationAndTransform(zeus::CTransf
void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) {
TCastToPtr<CPlayer> player(mgr.ObjectById(GetWatchedObject()));
if (!player) {
SetTransform(zeus::CTransform::Identity());
SetTransform(zeus::CTransform());
return;
}
@ -109,7 +109,7 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) {
vec.x() = std::sin(-player->x3e4_freeLookYawAngle) * std::cos(angle);
if (g_tweakPlayer->GetFreeLookTurnsPlayer()) {
vec.x() = 0.f;
if (!zeus::close_enough(vec, zeus::CVector3f::skZero))
if (!zeus::close_enough(vec, zeus::skZero3f))
vec.normalize();
}
@ -120,7 +120,7 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) {
if (x1d4_closeInTimer > 0.f) {
eyePos += zeus::clamp(0.f, 0.5f * x1d4_closeInTimer, 1.f) * x1c8_closeInVec;
player->GetCameraBob()->ResetCameraBobTime();
player->GetCameraBob()->SetCameraBobTransform(zeus::CTransform::Identity());
player->GetCameraBob()->SetCameraBobTransform(zeus::CTransform());
}
switch (player->GetOrbitState()) {
@ -183,7 +183,7 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) {
rVec.normalize();
zeus::CTransform gunXf = x190_gunFollowXf;
zeus::CQuaternion qGun = zeus::CQuaternion::skNoRotation;
zeus::CQuaternion qGun;
if (!player->x3dc_inFreeLook) {
switch (player->GetOrbitState()) {
@ -275,7 +275,7 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) {
player->GetGrappleState() != CPlayer::EGrappleState::None ||
mgr.GetGameState() == CStateManager::EGameState::SoftPaused || mgr.GetCameraManager()->IsInCinematicCamera() ||
x1d4_closeInTimer > 0.f) {
bobXf = zeus::CTransform::Identity();
bobXf = zeus::CTransform();
player->GetCameraBob()->SetCameraBobTransform(bobXf);
}
@ -294,7 +294,7 @@ void CFirstPersonCamera::UpdateElevation(CStateManager& mgr) {
zeus::CVector3f pitchDirFlat = pvol->GetTransform().basis[1];
pitchDirFlat.z() = 0.f;
if (!pitchDirFlat.canBeNormalized())
pitchDirFlat = zeus::CVector3f::skForward;
pitchDirFlat = zeus::skForward;
zeus::CVector3f playerDirFlat = player->GetTransform().basis[1];
playerDirFlat.z() = 0.f;

View File

@ -69,7 +69,7 @@ zeus::CTransform CGameCamera::ValidateCameraTransform(const zeus::CTransform& ne
!zeus::close_enough(newXf.frontVector().magnitude(), 1.f) ||
!zeus::close_enough(newXf.upVector().magnitude(), 1.f))
xfCpy.orthonormalize();
float f2 = zeus::clamp(-1.f, newXf.frontVector().dot(zeus::CVector3f::skUp), 1.f);
float f2 = zeus::clamp(-1.f, newXf.frontVector().dot(zeus::skUp), 1.f);
if (std::fabs(f2) > 0.999f)
xfCpy = oldXf;
@ -78,7 +78,7 @@ zeus::CTransform CGameCamera::ValidateCameraTransform(const zeus::CTransform& ne
if (!zeus::close_enough(xfCpy.rightVector().z(), 0.f) && !zeus::close_enough(xfCpy.upVector().z(), 0.f)) {
if (xfCpy.frontVector().canBeNormalized())
xfCpy = zeus::lookAt(zeus::CVector3f::skZero, xfCpy.frontVector());
xfCpy = zeus::lookAt(zeus::skZero3f, xfCpy.frontVector());
else
xfCpy = oldXf;
}

View File

@ -59,9 +59,9 @@ void CActorLights::BuildFakeLightList(const std::vector<CLight>& lights, const z
void CActorLights::BuildFaceLightList(const CStateManager& mgr, const CGameArea& area, const zeus::CAABox& aabb) {
zeus::CTransform fpTransform = mgr.GetCameraManager()->GetFirstPersonCamera()->GetTransform();
x288_ambientColor = zeus::CColor::skBlack;
x288_ambientColor = zeus::skBlack;
x144_dynamicLights.clear();
zeus::CColor accumColor = zeus::CColor::skBlack;
zeus::CColor accumColor = zeus::skBlack;
for (CEntity* light : mgr.GetLightObjectList()) {
if (!light || !light->GetActive())
continue;
@ -74,7 +74,7 @@ void CActorLights::BuildFaceLightList(const CStateManager& mgr, const CGameArea&
explosionLight.GetAttenuationLinear() * g_tweakGui->GetExplosionLightFalloffMultLinear(),
explosionLight.GetAttenuationQuadratic() * g_tweakGui->GetExplosionLightFalloffMultQuadratic());
zeus::CVector3f camToExplo = explosion->GetTranslation() - fpTransform.origin;
if (fpTransform.transposeRotate(camToExplo).dot(zeus::CVector3f::skForward) >= 0.f) {
if (fpTransform.transposeRotate(camToExplo).dot(zeus::skForward) >= 0.f) {
camToExplo.y() = -camToExplo.y() + ITweakGui::FaceReflectionDistanceDebugValueToActualValue(
g_tweakGui->GetFaceReflectionDistance());
camToExplo.z() = -camToExplo.z() +
@ -207,7 +207,7 @@ bool CActorLights::BuildAreaLightList(const CStateManager& mgr, const CGameArea&
x298_24_dirty = false;
x294_aid = area.GetAreaId();
x29c_shadowLightArrIdx = -1;
x288_ambientColor = zeus::CColor::skClear;
x288_ambientColor = zeus::skClear;
/* Find candidate lights via PVS */
bool use2ndLayer;
@ -292,12 +292,12 @@ bool CActorLights::BuildAreaLightList(const CStateManager& mgr, const CGameArea&
}
/* Ambient color for overflow area lights */
zeus::CColor overflowAmbColor = zeus::CColor::skClear;
zeus::CColor overflowAmbColor = zeus::skClear;
/* Averaged light for overflow area lights */
CLight overflowLight = CLight::BuildCustom(zeus::CVector3f::skZero, zeus::CVector3f::skZero, zeus::CColor::skBlack,
CLight overflowLight = CLight::BuildCustom(zeus::skZero3f, zeus::skZero3f, zeus::skBlack,
0.f, 0.f, 0.f, 0.f, 0.f, 0.f);
zeus::CColor overflowLightColor = zeus::CColor::skClear;
zeus::CColor overflowLightColor = zeus::skClear;
float overflowMag = 0.f;
/* Max significant lights */
@ -461,7 +461,7 @@ std::vector<CLight> CActorLights::BuildLightVector() const {
zeus::CColor ambColor = x288_ambientColor;
ambColor.a() = 1.f;
lights.push_back(CLight::BuildLocalAmbient(zeus::CVector3f::skZero, ambColor));
lights.push_back(CLight::BuildLocalAmbient(zeus::skZero3f, ambColor));
return lights;
}
@ -471,8 +471,8 @@ void CActorLights::ActivateLights(CBooModel& model) const {
if (x298_28_inArea) {
if (!x298_26_hasAreaLights || x299_26_ambientOnly) {
// g_Renderer->SetAmbientColor(zeus::CColor::skWhite);
lights.push_back(CLight::BuildLocalAmbient(zeus::CVector3f::skZero, zeus::CColor::skWhite));
// g_Renderer->SetAmbientColor(zeus::skWhite);
lights.push_back(CLight::BuildLocalAmbient(zeus::skZero3f, zeus::skWhite));
model.ActivateLights(lights);
return;
}

View File

@ -15,7 +15,7 @@ class CActorLights {
static s32 sFrameSchedulerCount;
std::vector<CLight> x0_areaLights;
std::vector<CLight> x144_dynamicLights;
zeus::CColor x288_ambientColor = zeus::CColor::skBlack;
zeus::CColor x288_ambientColor = zeus::skBlack;
TAreaId x294_aid = kInvalidAreaId;
union {

View File

@ -300,7 +300,7 @@ void CAnimData::SetRandomPlaybackRate(CRandom16& r) {
void CAnimData::CalcPlaybackAlignmentParms(const CAnimPlaybackParms& parms,
const std::shared_ptr<CAnimTreeNode>& node) {
zeus::CQuaternion orient;
x1e8_alignRot = zeus::CQuaternion::skNoRotation;
x1e8_alignRot = zeus::CQuaternion();
x220_27_ = false;
if (parms.GetDeltaOrient() && parms.GetObjectXform()) {
@ -311,7 +311,7 @@ void CAnimData::CalcPlaybackAlignmentParms(const CAnimPlaybackParms& parms,
CInt32POINode& poi = g_Int32POINodes[i];
if (poi.GetPoiType() == EPOIType::UserEvent && EUserEventType(poi.GetValue()) == EUserEventType::AlignTargetRot) {
SAdvancementResults res = node->VGetAdvancementResults(poi.GetTime(), 0.f);
orient = zeus::CQuaternion::slerp(zeus::CQuaternion::skNoRotation,
orient = zeus::CQuaternion::slerp(zeus::CQuaternion(),
*parms.GetDeltaOrient() *
zeus::CQuaternion(parms.GetObjectXform()->buildMatrix3f().inverted()) *
res.x8_deltas.xc_rotDelta.inverse(),
@ -369,7 +369,7 @@ void CAnimData::CalcPlaybackAlignmentParms(const CAnimPlaybackParms& parms,
x220_28_ = true;
x220_26_aligningPos = false;
} else {
x1dc_alignPos = zeus::CVector3f::skZero;
x1dc_alignPos = zeus::skZero3f;
x220_28_ = false;
x220_26_aligningPos = false;
}
@ -402,8 +402,8 @@ void CAnimData::CalcPlaybackAlignmentParms(const CAnimPlaybackParms& parms,
if (didAlign && didStart) {
CCharAnimTime frameInterval(1.f / 60.f);
orient = zeus::CQuaternion::skNoRotation;
x1e8_alignRot = zeus::CQuaternion::skNoRotation;
orient = zeus::CQuaternion();
x1e8_alignRot = zeus::CQuaternion();
x220_27_ = true;
CCharAnimTime time;
zeus::CVector3f pos;
@ -427,12 +427,12 @@ void CAnimData::CalcPlaybackAlignmentParms(const CAnimPlaybackParms& parms,
x220_28_ = true;
x220_26_aligningPos = false;
} else {
x1dc_alignPos = zeus::CVector3f::skZero;
x1dc_alignPos = zeus::skZero3f;
x220_28_ = false;
x220_26_aligningPos = false;
}
} else {
x1dc_alignPos = zeus::CVector3f::skZero;
x1dc_alignPos = zeus::skZero3f;
x220_28_ = false;
x220_26_aligningPos = false;
}
@ -702,7 +702,7 @@ SAdvancementDeltas CAnimData::DoAdvance(float dt, bool& suspendParticles, CRando
time = std::max(0.f, std::min(remTime.GetSeconds(), time.GetSeconds()));
if (remTime.EpsilonZero()) {
x220_24_animating = false;
x1dc_alignPos = zeus::CVector3f::skZero;
x1dc_alignPos = zeus::skZero3f;
x220_28_ = false;
x220_26_aligningPos = false;
}
@ -761,13 +761,13 @@ void CAnimData::AdvanceAnim(CCharAnimTime& time, zeus::CVector3f& offset, zeus::
break;
}
case EUserEventType::AlignTargetPos: {
x1dc_alignPos = zeus::CVector3f::skZero;
x1dc_alignPos = zeus::skZero3f;
x220_28_ = false;
x220_26_aligningPos = false;
break;
}
case EUserEventType::AlignTargetRot: {
x1e8_alignRot = zeus::CQuaternion::skNoRotation;
x1e8_alignRot = zeus::CQuaternion();
x220_27_ = false;
break;
}

View File

@ -66,7 +66,7 @@ void CBodyController::Update(float dt, CStateManager& mgr) {
if (x300_25_active) {
x300_24_animationOver = !x0_actor.GetModelData()->GetAnimationData()->IsAnimTimeRemaining(dt, "Whole Body"sv);
x4_cmdMgr.BlendSteeringCmds();
x2dc_rot = zeus::CQuaternion::skNoRotation;
x2dc_rot = zeus::CQuaternion();
UpdateBody(dt, mgr);
if (TCastToPtr<CPhysicsActor> act = x0_actor)
act->RotateInOneFrameOR(x2dc_rot, dt);
@ -158,8 +158,8 @@ void CBodyController::Freeze(float intoFreezeDur, float frozenDur, float breakou
if (TCastToPtr<CPhysicsActor> act = x0_actor) {
x314_backedUpForce = act->GetConstantForce();
act->SetConstantForce(zeus::CVector3f::skZero);
act->SetMomentumWR(zeus::CVector3f::skZero);
act->SetConstantForce(zeus::skZero3f);
act->SetMomentumWR(zeus::skZero3f);
}
x320_fireDur = 0.f;

View File

@ -28,7 +28,7 @@ void CBSAttack::Start(CBodyController& bc, CStateManager& mgr) {
CCharAnimTime::Infinity());
x30_alignTargetPosTime = (evTime != CCharAnimTime::Infinity()) ? evTime.GetSeconds() : bc.GetAnimTimeRemaining();
} else {
x20_targetPos = zeus::CVector3f::skZero;
x20_targetPos = zeus::skZero3f;
x2c_alignTargetPosStartTime = -1.f;
x30_alignTargetPosTime = -1.f;
}
@ -78,7 +78,7 @@ void CBSAttack::UpdatePhysicsActor(CBodyController& bc, float dt) {
if (dur > 0.f)
delta *= zeus::CVector3f(dt / dur);
zeus::CVector3f localDelta = act->GetTransform().transposeRotate(delta);
act->ApplyImpulseWR(act->GetMoveToORImpulseWR(localDelta, dt), zeus::CAxisAngle::sIdentity);
act->ApplyImpulseWR(act->GetMoveToORImpulseWR(localDelta, dt), zeus::CAxisAngle());
}
}
}
@ -810,7 +810,7 @@ void CBSJump::Start(CBodyController& bc, CStateManager& mgr) {
x30_27_wallBounceComplete = false;
if (x30_25_wallJump)
x30_26_wallBounceRight =
(xc_waypoint1 - bc.GetOwner().GetTranslation()).cross(zeus::CVector3f::skUp).dot(x24_waypoint2 - xc_waypoint1) <
(xc_waypoint1 - bc.GetOwner().GetTranslation()).cross(zeus::skUp).dot(x24_waypoint2 - xc_waypoint1) <
0.f;
if (!cmd->StartInJumpLoop()) {
x4_state = pas::EJumpState::IntoJump;
@ -921,7 +921,7 @@ pas::EAnimationState CBSJump::UpdateBody(float dt, CBodyController& bc, CStateMa
case pas::EJumpState::WallBounceRight:
if (TCastToPtr<CPhysicsActor> act = bc.GetOwner()) {
act->Stop();
act->SetMomentumWR(zeus::CVector3f::skZero);
act->SetMomentumWR(zeus::skZero3f);
}
if (bc.IsAnimationOver()) {
mgr.SendScriptMsg(&bc.GetOwner(), kInvalidUniqueId, EScriptObjectMessage::Falling);
@ -977,7 +977,7 @@ void CBSHurled::Start(CBodyController& bc, CStateManager& mgr) {
xc_animSeries = hurledState->GetAnimParmData(best.second, 0).GetInt32Value();
mgr.SendScriptMsg(&bc.GetOwner(), kInvalidUniqueId, EScriptObjectMessage::Falling);
mgr.SendScriptMsg(&bc.GetOwner(), kInvalidUniqueId, EScriptObjectMessage::Jumped);
if (!zeus::close_enough(cmd->GetLaunchVelocity(), zeus::CVector3f::skZero, 0.0001f))
if (!zeus::close_enough(cmd->GetLaunchVelocity(), zeus::skZero3f, 0.0001f))
if (TCastToPtr<CPhysicsActor> act = bc.GetOwner())
act->SetConstantForce(act->GetMass() * cmd->GetLaunchVelocity());
float animAngle = zeus::degToRad(hurledState->GetAnimParmData(best.second, 1).GetReal32Value());
@ -1014,7 +1014,7 @@ void CBSHurled::Recover(CStateManager& mgr, CBodyController& bc, pas::EHurledSta
bc.SetCurrentAnimation(playParms, false, false);
x4_state = state;
if (TCastToPtr<CPhysicsActor> act = bc.GetOwner())
act->SetMomentumWR(zeus::CVector3f::skZero);
act->SetMomentumWR(zeus::skZero3f);
}
x2c_24_needsRecover = false;
}
@ -1099,7 +1099,7 @@ pas::EAnimationState CBSHurled::UpdateBody(float dt, CBodyController& bc, CState
} else if (ShouldStartStrikeWall(bc)) {
PlayStrikeWallAnimation(bc, mgr);
if (TCastToPtr<CPatterned> ai = bc.GetOwner())
ai->SetVelocityWR(zeus::CVector3f::skDown * (2.f * dt * ai->GetGravityConstant()));
ai->SetVelocityWR(zeus::skDown * (2.f * dt * ai->GetGravityConstant()));
} else if (x2c_24_needsRecover) {
Recover(mgr, bc, pas::EHurledState::Six);
}
@ -1268,7 +1268,7 @@ void CBSCover::Start(CBodyController& bc, CStateManager& mgr) {
CPASAnimParmData parms(19, CPASAnimParm::FromEnum(s32(x4_state)), CPASAnimParm::FromEnum(s32(x8_coverDirection)));
std::pair<float, s32> best = bc.GetPASDatabase().FindBestAnimation(parms, *mgr.GetActiveRandom(), -1);
zeus::CQuaternion orientDelta =
zeus::CQuaternion::lookAt(zeus::CVector3f::skForward, cmd->GetAlignDirection(), 2.f * M_PIF);
zeus::CQuaternion::lookAt(zeus::skForward, cmd->GetAlignDirection(), 2.f * M_PIF);
CAnimPlaybackParms playParms(best.second, &orientDelta, &cmd->GetTarget(), &bc.GetOwner().GetTransform(),
&bc.GetOwner().GetModelData()->GetScale(), false);
bc.SetCurrentAnimation(playParms, false, false);
@ -1354,8 +1354,8 @@ pas::EAnimationState CBSWallHang::GetBodyStateTransition(float dt, CBodyControll
void CBSWallHang::FixInPlace(CBodyController& bc) {
if (TCastToPtr<CAi> ai = bc.GetOwner()) {
ai->SetConstantForce(zeus::CVector3f::skZero);
ai->SetVelocityWR(zeus::CVector3f::skZero);
ai->SetConstantForce(zeus::skZero3f);
ai->SetVelocityWR(zeus::skZero3f);
}
}
@ -1387,8 +1387,8 @@ bool CBSWallHang::CheckForWall(CBodyController& bc, CStateManager& mgr) {
CAnimPlaybackParms playParms(best.second, nullptr, &target, &bc.GetOwner().GetTransform(),
&bc.GetOwner().GetModelData()->GetScale(), false);
bc.SetCurrentAnimation(playParms, false, false);
ai->SetVelocityWR(zeus::CVector3f::skZero);
ai->SetMomentumWR(zeus::CVector3f::skZero);
ai->SetVelocityWR(zeus::skZero3f);
ai->SetMomentumWR(zeus::skZero3f);
mgr.SendScriptMsg(ai.GetPtr(), kInvalidUniqueId, EScriptObjectMessage::OnFloor);
return true;
}
@ -1515,7 +1515,7 @@ pas::EAnimationState CBSWallHang::UpdateBody(float dt, CBodyController& bc, CSta
} else {
xc_launchVel = -15.f * act->GetTransform().basis[1];
}
act->SetAngularMomentum(zeus::CAxisAngle::sIdentity);
act->SetAngularMomentum(zeus::CAxisAngle());
}
}
break;
@ -1639,7 +1639,7 @@ void CBSLocomotion::Shutdown(CBodyController& bc) { bc.MultiplyPlaybackRate(1.f)
float CBSLocomotion::ApplyLocomotionPhysics(float dt, CBodyController& bc) {
if (TCastToPtr<CPhysicsActor> act = bc.GetOwner()) {
zeus::CVector3f vec = (zeus::close_enough(bc.GetCommandMgr().GetFaceVector(), zeus::CVector3f::skZero, 0.0001f))
zeus::CVector3f vec = (zeus::close_enough(bc.GetCommandMgr().GetFaceVector(), zeus::skZero3f, 0.0001f))
? bc.GetCommandMgr().GetMoveVector()
: bc.GetCommandMgr().GetFaceVector();
if (vec.canBeNormalized()) {
@ -1861,8 +1861,8 @@ float CBSBiPedLocomotion::UpdateLocomotionAnimation(float dt, float velMag, CBod
}
bool CBSBiPedLocomotion::IsStrafing(const CBodyController& bc) const {
if (!zeus::close_enough(bc.GetCommandMgr().GetMoveVector(), zeus::CVector3f::skZero, 0.0001f))
if (!zeus::close_enough(bc.GetCommandMgr().GetFaceVector(), zeus::CVector3f::skZero, 0.0001f))
if (!zeus::close_enough(bc.GetCommandMgr().GetMoveVector(), zeus::skZero3f, 0.0001f))
if (!zeus::close_enough(bc.GetCommandMgr().GetFaceVector(), zeus::skZero3f, 0.0001f))
return true;
return false;
}
@ -1877,7 +1877,7 @@ float CBSFlyerLocomotion::ApplyLocomotionPhysics(float dt, CBodyController& bc)
(!x3cc_pitchable || bc.GetBodyStateInfo().GetMaximumPitch() < 0.17453292f)) {
zeus::CVector3f dir;
dir.z() = dt * bc.GetBodyStateInfo().GetMaxSpeed() * bc.GetCommandMgr().GetMoveVector().z();
act->ApplyImpulseWR(act->GetMoveToORImpulseWR(dir, dt), zeus::CAxisAngle::sIdentity);
act->ApplyImpulseWR(act->GetMoveToORImpulseWR(dir, dt), zeus::CAxisAngle());
}
}
return ret;
@ -1969,7 +1969,7 @@ float CBSRestrictedFlyerLocomotion::ApplyLocomotionPhysics(float dt, CBodyContro
if (TCastToPtr<CPhysicsActor> act = bc.GetOwner()) {
bc.FaceDirection(bc.GetCommandMgr().GetFaceVector(), dt);
act->ApplyImpulseWR(bc.GetCommandMgr().GetMoveVector() * bc.GetRestrictedFlyerMoveSpeed() * act->GetMass(),
zeus::CAxisAngle::sIdentity);
zeus::CAxisAngle());
}
return 0.f;
}

View File

@ -52,14 +52,14 @@ void CBodyStateCmdMgr::BlendSteeringCmds() {
x0_move *= zeus::CVector3f(stepMul);
break;
case ESteeringBlendMode::FullSpeed:
if (!zeus::close_enough(x0_move, zeus::CVector3f::skZero, 0.0001f)) {
if (!zeus::close_enough(x0_move, zeus::skZero3f, 0.0001f)) {
x0_move.normalize();
x0_move *= zeus::CVector3f(x38_steeringSpeedMax);
}
break;
case ESteeringBlendMode::Clamped:
x0_move *= zeus::CVector3f(stepMul);
if (!zeus::close_enough(x0_move, zeus::CVector3f::skZero, 0.0001f)) {
if (!zeus::close_enough(x0_move, zeus::skZero3f, 0.0001f)) {
if (x0_move.magnitude() < x34_steeringSpeedMin)
x0_move = x0_move.normalized() * x34_steeringSpeedMin;
else if (x0_move.magnitude() > x38_steeringSpeedMax)
@ -73,16 +73,16 @@ void CBodyStateCmdMgr::BlendSteeringCmds() {
}
void CBodyStateCmdMgr::Reset() {
x0_move = zeus::CVector3f::skZero;
xc_face = zeus::CVector3f::skZero;
x18_target = zeus::CVector3f::skZero;
x0_move = zeus::skZero3f;
xc_face = zeus::skZero3f;
x18_target = zeus::skZero3f;
x3c_steeringSpeed = 0.f;
xb4_deliveredCmdMask = 0;
}
void CBodyStateCmdMgr::ClearLocomotionCmds() {
x0_move = zeus::CVector3f::skZero;
xc_face = zeus::CVector3f::skZero;
x0_move = zeus::skZero3f;
xc_face = zeus::skZero3f;
x3c_steeringSpeed = 0.f;
}

View File

@ -64,23 +64,23 @@ void CBoneTracking::PreRender(const CStateManager& mgr, CAnimData& animData, con
angle = std::min(angle, x1c_maxTrackingAngle);
localDir = zeus::CVector3f::slerp(ikBase, localDir, angle);
} else {
float angle = zeus::CVector3f::getAngleDiff(zeus::CVector3f::skForward, localDir);
float angle = zeus::CVector3f::getAngleDiff(zeus::skForward, localDir);
angle = std::min(angle, x1c_maxTrackingAngle);
localDir = zeus::CVector3f::slerp(zeus::CVector3f::skForward, localDir, angle);
localDir = zeus::CVector3f::slerp(zeus::skForward, localDir, angle);
}
float angle = zeus::CVector3f::getAngleDiff(x0_curRotation.transform(zeus::CVector3f::skForward), localDir);
float angle = zeus::CVector3f::getAngleDiff(x0_curRotation.transform(zeus::skForward), localDir);
float clampedAngle = std::min(angle, x18_time * x20_angSpeed);
if (clampedAngle > 1.0e-05f) {
x0_curRotation = zeus::CQuaternion::slerpShort(x0_curRotation,
zeus::CQuaternion::lookAt(zeus::CVector3f::skForward, zeus::CUnitVector3f(localDir), 2.f * M_PIF),
zeus::CQuaternion::lookAt(zeus::skForward, zeus::CUnitVector3f(localDir), 2.f * M_PIF),
clampedAngle / angle);
}
pb.GetTreeMap()[x14_segId].x4_rotation = x0_curRotation;
animData.MarkPoseDirty();
} else if (x36_25_hasTrackedRotation) {
zeus::CQuaternion qb = pb.GetTreeMap()[x14_segId].x4_rotation;
float angle = zeus::CVector3f::getAngleDiff(x0_curRotation.transform(zeus::CVector3f::skForward),
qb.transform(zeus::CVector3f::skForward));
float angle = zeus::CVector3f::getAngleDiff(x0_curRotation.transform(zeus::skForward),
qb.transform(zeus::skForward));
float maxAngDelta = x18_time * x20_angSpeed;
float clampedAngle = std::min(angle, maxAngDelta);
if (clampedAngle > 0.5f * maxAngDelta) {

View File

@ -12,7 +12,7 @@ class CAnimData;
class CStateManager;
class CBodyController;
class CBoneTracking {
zeus::CQuaternion x0_curRotation = zeus::CQuaternion::skNoRotation;
zeus::CQuaternion x0_curRotation = zeus::CQuaternion();
float x10_ = 0.f;
CSegId x14_segId;
float x18_time = 0.f;

View File

@ -29,7 +29,7 @@ void CGroundMovement::CheckFalling(CPhysicsActor& actor, CStateManager& mgr, flo
zeus::CVector3f vel = actor.GetTransform().transposeRotate(actor.GetVelocity());
vel.z() = 0.f;
actor.SetVelocityOR(vel);
actor.SetMomentumWR(zeus::CVector3f::skZero);
actor.SetMomentumWR(zeus::skZero3f);
}
}
@ -105,7 +105,7 @@ void CGroundMovement::MoveGroundCollider(CStateManager& mgr, CPhysicsActor& acto
}
actor.ClearForcesAndTorques();
actor.MoveCollisionPrimitive(zeus::CVector3f::skZero);
actor.MoveCollisionPrimitive(zeus::skZero3f);
if (actor.GetMaterialList().HasMaterial(EMaterialTypes::Player)) {
CGameCollision::CollisionFailsafe(mgr, cache, actor, *actor.GetCollisionPrimitive(), useColliderList, 0.f, 1);
}
@ -118,8 +118,8 @@ bool CGroundMovement::ResolveUpDown(CAreaCollisionCache& cache, CStateManager& m
if (list.GetCount() <= 0)
return true;
zeus::CAABox aabb = zeus::CAABox::skInvertedBox;
zeus::CVector3f normAccum = zeus::CVector3f::skZero;
zeus::CAABox aabb = zeus::CAABox();
zeus::CVector3f normAccum = zeus::skZero3f;
for (CCollisionInfo& info : list) {
if (CGameCollision::IsFloor(info.GetMaterialLeft(), info.GetNormalLeft())) {
aabb.accumulateBounds(info.GetPoint());
@ -150,7 +150,7 @@ bool CGroundMovement::ResolveUpDown(CAreaCollisionCache& cache, CStateManager& m
actor.GetPrimitiveTransform(), filter, nearList)) {
fOut = zextent;
actor.SetTranslation(actor.GetTranslation() + zeus::CVector3f(0.f, 0.f, zextent));
actor.MoveCollisionPrimitive(zeus::CVector3f::skZero);
actor.MoveCollisionPrimitive(zeus::skZero3f);
bool floor = false;
for (CCollisionInfo& info : list) {
@ -175,7 +175,7 @@ bool CGroundMovement::MoveGroundColliderZ(CAreaCollisionCache& cache, CStateMana
CCollisionInfoList& list, TUniqueId& idOut) {
actor.MoveCollisionPrimitive({0.f, 0.f, amt});
zeus::CAABox aabb = zeus::CAABox::skInvertedBox;
zeus::CAABox aabb = zeus::CAABox();
if (CGameCollision::DetectCollision_Cached(mgr, cache, *actor.GetCollisionPrimitive(), actor.GetPrimitiveTransform(),
filter, nearList, idOut, list)) {
for (CCollisionInfo& info : list) {
@ -195,7 +195,7 @@ bool CGroundMovement::MoveGroundColliderZ(CAreaCollisionCache& cache, CStateMana
if (!CGameCollision::DetectCollisionBoolean_Cached(mgr, cache, *actor.GetCollisionPrimitive(),
actor.GetPrimitiveTransform(), filter, nearList)) {
actor.SetTranslation(actor.GetTranslation() + zeus::CVector3f(0.f, 0.f, zextent));
actor.MoveCollisionPrimitive(zeus::CVector3f::skZero);
actor.MoveCollisionPrimitive(zeus::skZero3f);
}
bool floor = false;
@ -259,7 +259,7 @@ void CGroundMovement::MoveGroundColliderXY(CAreaCollisionCache& cache, CStateMan
actor.GetPrimitiveTransform(), filter, nearList, otherId, collisionList);
if (collided)
otherActor = mgr.ObjectById(otherId);
actor.MoveCollisionPrimitive(zeus::CVector3f::skZero);
actor.MoveCollisionPrimitive(zeus::skZero3f);
if (collided) {
didCollide = true;
if (newMState.x0_translation.magnitude() < divMag) {
@ -297,7 +297,7 @@ void CGroundMovement::MoveGroundColliderXY(CAreaCollisionCache& cache, CStateMan
actor.AddMotionState(newMState);
remDt -= dt;
dt = nonCollideDt;
actor.MoveCollisionPrimitive(zeus::CVector3f::skZero);
actor.MoveCollisionPrimitive(zeus::skZero3f);
}
newMState = actor.PredictMotion_Internal(dt);
@ -306,7 +306,7 @@ void CGroundMovement::MoveGroundColliderXY(CAreaCollisionCache& cache, CStateMan
if (!didCollide && !actor.GetMaterialList().HasMaterial(EMaterialTypes::GroundCollider))
mgr.SendScriptMsg(&actor, kInvalidUniqueId, EScriptObjectMessage::Falling);
actor.MoveCollisionPrimitive(zeus::CVector3f::skZero);
actor.MoveCollisionPrimitive(zeus::skZero3f);
}
zeus::CVector3f CGroundMovement::CollisionDamping(const zeus::CVector3f& vel, const zeus::CVector3f& dir,
@ -610,7 +610,7 @@ CMaterialList CGroundMovement::MoveObjectAnalytical(CStateManager& mgr, CPhysics
SMoveObjectResult& result) {
result.x6c_processedCollisions = 0;
CMaterialList ret;
zeus::CVector3f floorPlaneNormal = opts.x3c_floorPlaneNormal ? *opts.x3c_floorPlaneNormal : zeus::CVector3f::skZero;
zeus::CVector3f floorPlaneNormal = opts.x3c_floorPlaneNormal ? *opts.x3c_floorPlaneNormal : zeus::skZero3f;
bool floorCollision = opts.x3c_floorPlaneNormal.operator bool();
float remDt = dt;
for (int i = 0; remDt > 0.f; ++i) {
@ -678,7 +678,7 @@ CMaterialList CGroundMovement::MoveObjectAnalytical(CStateManager& mgr, CPhysics
actor.GetVelocity().canBeNormalized()
? CGroundMovement::CollisionDamping(actor.GetVelocity(), actor.GetVelocity().normalized(), collisionNorm,
opts.x24_dampedNormalCoefficient, opts.x28_dampedDeltaCoefficient)
: zeus::CVector3f::skZero;
: zeus::skZero3f;
float elasticForce = floor ? opts.x2c_floorElasticForce
: opts.x34_wallElasticLinear * collisionFloorDot + opts.x30_wallElasticConstant;
float dot = collisionNorm.dot(vel);

View File

@ -13,8 +13,8 @@ class CIkChain {
CSegId x0_bone;
CSegId x1_p1;
CSegId x2_p2;
zeus::CVector3f x4_p2p1Dir = zeus::CVector3f::skForward;
zeus::CVector3f x10_p1BoneDir = zeus::CVector3f::skForward;
zeus::CVector3f x4_p2p1Dir = zeus::skForward;
zeus::CVector3f x10_p1BoneDir = zeus::skForward;
float x1c_p2p1Length = 1.f;
float x20_p1BoneLength = 1.f;
zeus::CQuaternion x24_holdRot;

View File

@ -307,7 +307,7 @@ void CModelData::RenderUnsortedParts(EWhichModel which, const zeus::CTransform&
lights->ActivateLights(*model);
} else {
std::vector<CLight> useLights;
useLights.push_back(CLight::BuildLocalAmbient(zeus::CVector3f::skZero, x18_ambientColor));
useLights.push_back(CLight::BuildLocalAmbient(zeus::skZero3f, x18_ambientColor));
model->ActivateLights(useLights);
}
@ -331,7 +331,7 @@ void CModelData::Render(EWhichModel which, const zeus::CTransform& xf, const CAc
lights->ActivateLights(*model.GetModelInst());
} else {
std::vector<CLight> useLights;
useLights.push_back(CLight::BuildLocalAmbient(zeus::CVector3f::skZero, x18_ambientColor));
useLights.push_back(CLight::BuildLocalAmbient(zeus::skZero3f, x18_ambientColor));
model.GetModelInst()->ActivateLights(useLights);
}
@ -342,7 +342,7 @@ void CModelData::Render(EWhichModel which, const zeus::CTransform& xf, const CAc
lights->ActivateLights(*model);
} else {
std::vector<CLight> useLights;
useLights.push_back(CLight::BuildLocalAmbient(zeus::CVector3f::skZero, x18_ambientColor));
useLights.push_back(CLight::BuildLocalAmbient(zeus::skZero3f, x18_ambientColor));
model->ActivateLights(useLights);
}
@ -368,7 +368,7 @@ void CModelData::InvSuitDraw(EWhichModel which, const zeus::CTransform& xf, cons
/* Z-prime */
flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly;
flags.x4_color = zeus::CColor::skWhite;
flags.x4_color = zeus::skWhite;
x10_animData->Render(model, flags, {}, nullptr);
/* Normal Blended */
@ -388,7 +388,7 @@ void CModelData::InvSuitDraw(EWhichModel which, const zeus::CTransform& xf, cons
/* Z-prime */
flags.m_extendedShader = EExtendedShader::SolidColorBackfaceCullLEqualAlphaOnly;
flags.x4_color = zeus::CColor::skWhite;
flags.x4_color = zeus::skWhite;
model.Draw(flags, nullptr, nullptr);
/* Normal Blended */
@ -415,7 +415,7 @@ void CModelData::DisintegrateDraw(EWhichModel which, const zeus::CTransform& xf,
CGraphics::SetModelMatrix(scaledXf);
CBooModel::SetDisintegrateTexture(tex.GetBooTexture());
CModelFlags flags(5, 0, 3, zeus::CColor::skWhite);
CModelFlags flags(5, 0, 3, zeus::skWhite);
flags.m_extendedShader = EExtendedShader::Disintegrate;
flags.addColor = addColor;
flags.addColor.a() = t; // Stash T value in here (shader does not care)

View File

@ -105,7 +105,7 @@ void CParticleDatabase::UpdateParticleGenDB(float dt, const CPoseAsTransforms& p
switch (info.GetParentedMode()) {
case CParticleData::EParentedMode::Initial: {
if (info.GetIsGrabInitialData()) {
zeus::CTransform segXf((info.GetFlags() & 0x10) ? zeus::CMatrix3f::skIdentityMatrix3f
zeus::CTransform segXf((info.GetFlags() & 0x10) ? zeus::CMatrix3f()
: pose.GetTransformMinusOffset(segId),
off * scale);
zeus::CTransform compXf = xf * segXf;

View File

@ -154,7 +154,7 @@ void CRagDoll::CheckStatic(float dt) {
x54_impactVel = 0.f;
float halfDt = 0.5f * dt;
float halfDeltaUnitSq = halfDt * halfDt;
x58_averageVel = zeus::CVector3f::skZero;
x58_averageVel = zeus::skZero3f;
bool movingSlowly = true;
for (auto& particle : x4_particles) {
zeus::CVector3f delta = particle.x4_curPos - particle.x14_prevPos;
@ -181,7 +181,7 @@ void CRagDoll::CheckStatic(float dt) {
void CRagDoll::ClearForces() {
for (auto& particle : x4_particles)
particle.x20_velocity = zeus::CVector3f::skZero;
particle.x20_velocity = zeus::skZero3f;
}
void CRagDoll::SatisfyConstraints(CStateManager& mgr) {
@ -285,7 +285,7 @@ void CRagDoll::Verlet(float dt) {
if (deltaPos.magSquared() > 4.f)
particle.x4_curPos = deltaPos.normalized() * 2.f + particle.x14_prevPos;
particle.x3c_24_impactPending = false;
particle.x2c_impactResponseDelta = zeus::CVector3f::skZero;
particle.x2c_impactResponseDelta = zeus::skZero3f;
}
}

View File

@ -8,7 +8,7 @@ void CSegStatementSet::Add(const CSegIdList& list, const CCharLayoutInfo& layout
float weight) {
for (const CSegId& id : list.GetList()) {
x4_segData[id].x0_rotation *=
zeus::CQuaternion::slerp(zeus::CQuaternion::skNoRotation, other.x4_segData[id].x0_rotation, weight);
zeus::CQuaternion::slerp(zeus::CQuaternion(), other.x4_segData[id].x0_rotation, weight);
if (other.x4_segData[id].x1c_hasOffset && x4_segData[id].x1c_hasOffset) {
zeus::CVector3f off = other.x4_segData[id].x10_offset - layout.GetFromParentUnrotated(id);
x4_segData[id].x10_offset += off * weight;

View File

@ -272,7 +272,7 @@ bool CSteeringBehaviors::ProjectOrbitalIntersection(const zeus::CVector3f& v0, f
float f18 = FLT_MAX;
zeus::CVector3f _150 = _12c.normalized();
float f26 = _150.dot(f22);
float f27 = _150.cross(zeus::CVector3f::skUp).dot(f22);
float f27 = _150.cross(zeus::skUp).dot(f22);
for (float f19 = 0.f; f17 < f18 && f19 < 4.f;) {
if (zeus::close_enough(f17, f2) || f17 < 0.f) {
v4 = f25;
@ -284,7 +284,7 @@ bool CSteeringBehaviors::ProjectOrbitalIntersection(const zeus::CVector3f& v0, f
if (!_12c.canBeNormalized())
break;
zeus::CVector3f _168 = _12c.normalized();
f22 = _168.cross(zeus::CVector3f::skUp) * f27 + f26 * _168;
f22 = _168.cross(zeus::skUp) * f27 + f26 * _168;
f19 += f2;
f17 = (f25 - v0).magnitude() / f1 - f19;
}
@ -312,7 +312,7 @@ bool CSteeringBehaviors::ProjectOrbitalIntersection(const zeus::CVector3f& v0, f
float f17 = FLT_MAX;
zeus::CVector3f _150 = _12c.normalized();
float f25 = _150.dot(f21);
float f26 = _150.cross(zeus::CVector3f::skUp).dot(f21);
float f26 = _150.cross(zeus::skUp).dot(f21);
for (float f18 = 0.f; f16 < f17 && f18 < 4.f;) {
if (zeus::close_enough(f16, f2) || f16 < 0.f) {
v5 = f24;
@ -326,7 +326,7 @@ bool CSteeringBehaviors::ProjectOrbitalIntersection(const zeus::CVector3f& v0, f
if (!_12c.canBeNormalized())
break;
zeus::CVector3f _168 = _12c.normalized();
f21 = _168.cross(zeus::CVector3f::skUp) * f26 + f25 * _168;
f21 = _168.cross(zeus::skUp) * f26 + f25 * _168;
}
} else {
return ProjectLinearIntersection(v0, f1, v1, v2, v3, v5);
@ -346,14 +346,14 @@ zeus::CVector3f CSteeringBehaviors::ProjectOrbitalPosition(const zeus::CVector3f
zeus::CVector3f useVel = vel;
pointToPos.normalize();
float f29 = pointToPos.dot(useVel);
float f30 = pointToPos.cross(zeus::CVector3f::skUp).dot(useVel);
float f30 = pointToPos.cross(zeus::skUp).dot(useVel);
for (float curDt = 0.f; curDt < dt;) {
usePos += preThinkDt * useVel;
zeus::CVector3f usePointToPos = usePos - orbitPoint;
usePointToPos.z() = 0.f;
if (usePointToPos.canBeNormalized()) {
usePointToPos.normalize();
useVel = usePointToPos.cross(zeus::CVector3f::skUp) * f30 + usePointToPos * f29;
useVel = usePointToPos.cross(zeus::skUp) * f30 + usePointToPos * f29;
}
curDt += std::min(dt - curDt, preThinkDt);
}

View File

@ -440,7 +440,7 @@ CAreaOctTree::Node CAreaOctTree::Node::GetChild(int idx) const {
zeus::CAABox aabbObj(aabb[0], aabb[1], aabb[2], aabb[3], aabb[4], aabb[5]);
return Node(aabb, aabbObj, x1c_owner, ETreeType::Leaf);
} else {
return Node(nullptr, zeus::CAABox::skNullBox, x1c_owner, ETreeType::Invalid);
return Node(nullptr, zeus::skNullBox, x1c_owner, ETreeType::Invalid);
}
}

View File

@ -522,7 +522,7 @@ bool CCollidableOBBTree::AABoxCollideWithLeaf(const COBBTree::CLeafData& leaf, c
triMat.Add(CMaterialList(surf.GetSurfaceFlags()));
if (filter.Passes(triMat) &&
CollisionUtil::TriBoxOverlap(center, extent, surf.GetVert(0), surf.GetVert(1), surf.GetVert(2))) {
zeus::CAABox newAABB = zeus::CAABox::skInvertedBox;
zeus::CAABox newAABB = zeus::CAABox();
const_cast<CCollidableOBBTree&>(*this).x1c_hits += 1;
if (CMetroidAreaCollider::ConvexPolyCollision(planes, surf.GetVerts(), newAABB)) {
zeus::CPlane plane = surf.GetPlane();

View File

@ -10,7 +10,7 @@ class CRayCastInfo {
const zeus::CMRay& x0_ray;
const CMaterialFilter& x4_filter;
float x8_mag;
zeus::CPlane xc_plane = {zeus::CVector3f::skUp, 0.f};
zeus::CPlane xc_plane = {zeus::skUp, 0.f};
CMaterialList x20_material;
public:

View File

@ -64,7 +64,7 @@ CRayCastResult CCollidableOBBTreeGroup::CastRayInternal(const CInternalRayCastSt
float tMin = 0.f;
float tMax = 0.f;
if (CollisionUtil::RayAABoxIntersection(xfRay, *aabbIt++, tMin, tMax)) {
CInternalRayCastStructure localCast(xfRay.start, xfRay.dir, mag, zeus::CTransform::Identity(),
CInternalRayCastStructure localCast(xfRay.start, xfRay.dir, mag, zeus::CTransform(),
rayCast.GetFilter());
CRayCastResult localResult = obbTree.CastRayInternal(localCast);
if (localResult.IsValid()) {
@ -157,12 +157,12 @@ bool CCollidableOBBTreeGroup::AABoxCollide(const CInternalCollisionStructure& co
zeus::COBBox p0Obb = zeus::COBBox::FromAABox(p0.CalculateLocalAABox(), collision.GetRight().GetTransform().inverse() *
collision.GetLeft().GetTransform());
zeus::CPlane planes[] = {{zeus::CVector3f::skRight, b0.min.dot(zeus::CVector3f::skRight)},
{zeus::CVector3f::skLeft, b0.max.dot(zeus::CVector3f::skLeft)},
{zeus::CVector3f::skForward, b0.min.dot(zeus::CVector3f::skForward)},
{zeus::CVector3f::skBack, b0.max.dot(zeus::CVector3f::skBack)},
{zeus::CVector3f::skUp, b0.min.dot(zeus::CVector3f::skUp)},
{zeus::CVector3f::skDown, b0.max.dot(zeus::CVector3f::skDown)}};
zeus::CPlane planes[] = {{zeus::skRight, b0.min.dot(zeus::skRight)},
{zeus::skLeft, b0.max.dot(zeus::skLeft)},
{zeus::skForward, b0.min.dot(zeus::skForward)},
{zeus::skBack, b0.max.dot(zeus::skBack)},
{zeus::skUp, b0.min.dot(zeus::skUp)},
{zeus::skDown, b0.max.dot(zeus::skDown)}};
for (const std::unique_ptr<COBBTree>& tree : p1.x10_container->x0_trees) {
CCollidableOBBTree obbTree(tree.get(), p1.GetMaterial());

View File

@ -161,7 +161,7 @@ bool Sphere_Sphere(const CInternalCollisionStructure& collision, CCollisionInfoL
float deltaMagSq = delta.magSquared();
if (deltaMagSq <= radiusSum * radiusSum) {
zeus::CVector3f deltaNorm =
delta.canBeNormalized() ? (1.f / std::sqrt(deltaMagSq)) * delta : zeus::CVector3f::skRight;
delta.canBeNormalized() ? (1.f / std::sqrt(deltaMagSq)) * delta : zeus::skRight;
zeus::CVector3f collisionPoint = deltaNorm * s1.radius + s1.position;
CCollisionInfo info(collisionPoint, p0.GetMaterial(), p1.GetMaterial(), deltaNorm);
list.Add(info, false);

View File

@ -14,8 +14,8 @@ static const CMaterialList gkDefaultCollisionActorMaterials =
CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, const zeus::CVector3f& extent,
const zeus::CVector3f& center, bool active, float mass, std::string_view name)
: CPhysicsActor(uid1, active, "CollisionActor", CEntityInfo(aId, CEntity::NullConnectionList),
zeus::CTransform::Identity(), CModelData::CModelDataNull(), gkDefaultCollisionActorMaterials,
zeus::CAABox::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
zeus::CTransform(), CModelData::CModelDataNull(), gkDefaultCollisionActorMaterials,
zeus::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
, x258_primitiveType(EPrimitiveType::OBBTreeGroup)
, x25c_owner(uid2)
, x260_boxSize(extent)
@ -33,8 +33,8 @@ CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, co
CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, const zeus::CVector3f& boxSize,
bool active, float mass, std::string_view name)
: CPhysicsActor(uid1, active, "CollisionActor", CEntityInfo(aId, CEntity::NullConnectionList),
zeus::CTransform::Identity(), CModelData::CModelDataNull(), gkDefaultCollisionActorMaterials,
zeus::CAABox::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
zeus::CTransform(), CModelData::CModelDataNull(), gkDefaultCollisionActorMaterials,
zeus::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
, x258_primitiveType(EPrimitiveType::AABox)
, x25c_owner(uid2)
, x260_boxSize(boxSize)
@ -51,11 +51,11 @@ CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, co
CCollisionActor::CCollisionActor(TUniqueId uid1, TAreaId aId, TUniqueId uid2, bool active, float radius, float mass,
std::string_view name)
: CPhysicsActor(uid1, active, "CollisionActor", CEntityInfo(aId, CEntity::NullConnectionList),
zeus::CTransform::Identity(), CModelData::CModelDataNull(), gkDefaultCollisionActorMaterials,
zeus::CAABox::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
zeus::CTransform(), CModelData::CModelDataNull(), gkDefaultCollisionActorMaterials,
zeus::skNullBox, SMoverData(mass), CActorParameters::None(), 0.3f, 0.1f)
, x258_primitiveType(EPrimitiveType::Sphere)
, x25c_owner(uid2)
, x284_spherePrimitive(new CCollidableSphere(zeus::CSphere(zeus::CVector3f::skZero, radius),
, x284_spherePrimitive(new CCollidableSphere(zeus::CSphere(zeus::skZero3f, radius),
CMaterialList(EMaterialTypes::NoStaticCollision, EMaterialTypes::Solid)))
, x288_sphereRadius(radius) {
x10_name += ' ';

View File

@ -23,7 +23,7 @@ class CCollisionActor : public CPhysicsActor {
CDamageVulnerability x294_damageVuln = CDamageVulnerability::NormalVulnerabilty();
TUniqueId x2fc_lastTouched = kInvalidUniqueId;
EWeaponCollisionResponseTypes x300_responseType = EWeaponCollisionResponseTypes::EnemyNormal;
zeus::CVector3f x304_extendedTouchBounds = zeus::CVector3f::skZero;
zeus::CVector3f x304_extendedTouchBounds = zeus::skZero3f;
public:
CCollisionActor(TUniqueId, TAreaId, TUniqueId, const zeus::CVector3f&, const zeus::CVector3f&, bool, float,

View File

@ -73,7 +73,7 @@ CCollisionActorManager::CCollisionActorManager(CStateManager& mgr, TUniqueId own
zeus::CVector3f upVector = locXf.basis[2];
if (zeus::close_enough(std::fabs(delta.dot(upVector)), 1.f))
upVector = locXf.basis[1];
zeus::CTransform lookAt = zeus::lookAt(zeus::CVector3f::skZero, delta, upVector);
zeus::CTransform lookAt = zeus::lookAt(zeus::skZero3f, delta, upVector);
newAct2->SetTransform(zeus::CTransform::Translate(lookAt.basis[1] * separation + locXf.origin));
}
mgr.AddObject(newAct2);

View File

@ -124,7 +124,7 @@ void CGameCollision::MoveAndCollide(CStateManager& mgr, CPhysicsActor& actor, fl
DetectCollision_Cached(mgr, cache, *actor.GetCollisionPrimitive(), actor.GetPrimitiveTransform(),
actor.GetMaterialFilter(), useColliderList, id, accumList);
TCastToPtr<CPhysicsActor> otherActor = mgr.ObjectById(id);
actor.MoveCollisionPrimitive(zeus::CVector3f::skZero);
actor.MoveCollisionPrimitive(zeus::skZero3f);
zeus::CVector3f relVel = GetActorRelativeVelocities(actor, otherActor.GetPtr());
CCollisionInfoList filterList0, filterList1;
CollisionUtil::FilterOutBackfaces(relVel, accumList, filterList0);
@ -152,7 +152,7 @@ void CGameCollision::MoveAndCollide(CStateManager& mgr, CPhysicsActor& actor, fl
_4AC4 -= f31;
f31 = f27;
actor.ClearImpulses();
actor.MoveCollisionPrimitive(zeus::CVector3f::skZero);
actor.MoveCollisionPrimitive(zeus::skZero3f);
}
++r26;
@ -170,7 +170,7 @@ void CGameCollision::MoveAndCollide(CStateManager& mgr, CPhysicsActor& actor, fl
CollisionFailsafe(mgr, cache, actor, *actor.GetCollisionPrimitive(), useColliderList, f27, 2);
actor.ClearForcesAndTorques();
actor.MoveCollisionPrimitive(zeus::CVector3f::skZero);
actor.MoveCollisionPrimitive(zeus::skZero3f);
}
zeus::CVector3f CGameCollision::GetActorRelativeVelocities(const CPhysicsActor& act0, const CPhysicsActor* act1) {
@ -755,19 +755,19 @@ void CGameCollision::CollideWithDynamicBodyNoRot(CPhysicsActor& a0, CPhysicsActo
if (a0Move) {
if (a1Move) {
float impulse = CollisionImpulseFiniteVsFinite(a0.GetMass(), a1.GetMass(), velNormDot, restitution);
a0.ApplyImpulseWR(normal * impulse, zeus::CAxisAngle::sIdentity);
a1.ApplyImpulseWR(normal * -impulse, zeus::CAxisAngle::sIdentity);
a0.ApplyImpulseWR(normal * impulse, zeus::CAxisAngle());
a1.ApplyImpulseWR(normal * -impulse, zeus::CAxisAngle());
} else {
float impulse = CollisionImpulseFiniteVsInfinite(a0.GetMass(), velNormDot, restitution);
a0.ApplyImpulseWR(normal * impulse, zeus::CAxisAngle::sIdentity);
a0.ApplyImpulseWR(normal * impulse, zeus::CAxisAngle());
}
} else {
if (a1Move) {
float impulse = CollisionImpulseFiniteVsInfinite(a1.GetMass(), velNormDot, restitution);
a1.ApplyImpulseWR(normal * -impulse, zeus::CAxisAngle::sIdentity);
a1.ApplyImpulseWR(normal * -impulse, zeus::CAxisAngle());
} else {
a0.SetVelocityWR(zeus::CVector3f::skZero);
a1.SetVelocityWR(zeus::CVector3f::skZero);
a0.SetVelocityWR(zeus::skZero3f);
a1.SetVelocityWR(zeus::skZero3f);
}
}
a0.UseCollisionImpulses();
@ -775,12 +775,12 @@ void CGameCollision::CollideWithDynamicBodyNoRot(CPhysicsActor& a0, CPhysicsActo
} else if (velNormDot < 0.1f) {
if (a0Move) {
float impulse = 0.05f * a0.GetMass();
a0.ApplyImpulseWR(normal * impulse, zeus::CAxisAngle::sIdentity);
a0.ApplyImpulseWR(normal * impulse, zeus::CAxisAngle());
a0.UseCollisionImpulses();
}
if (a1Move) {
float impulse = -0.05f * a1.GetMass();
a1.ApplyImpulseWR(normal * impulse, zeus::CAxisAngle::sIdentity);
a1.ApplyImpulseWR(normal * impulse, zeus::CAxisAngle());
a1.UseCollisionImpulses();
}
}
@ -802,10 +802,10 @@ void CGameCollision::CollideWithStaticBodyNoRot(CPhysicsActor& a0, const CMateri
float velNormDot = a0.GetVelocity().dot(useNorm);
if (velNormDot < 0.0001f) {
a0.ApplyImpulseWR(useNorm * CollisionImpulseFiniteVsInfinite(a0.GetMass(), velNormDot, restitution),
zeus::CAxisAngle::sIdentity);
zeus::CAxisAngle());
a0.UseCollisionImpulses();
} else if (velNormDot < 0.001f) {
a0.ApplyImpulseWR(0.05f * a0.GetMass() * useNorm, zeus::CAxisAngle::sIdentity);
a0.ApplyImpulseWR(0.05f * a0.GetMass() * useNorm, zeus::CAxisAngle());
a0.UseCollisionImpulses();
}
}
@ -815,7 +815,7 @@ void CGameCollision::CollisionFailsafe(const CStateManager& mgr, CAreaCollisionC
const CCollisionPrimitive& prim,
const rstl::reserved_vector<TUniqueId, 1024>& nearList, float f1,
u32 failsafeTicks) {
actor.MoveCollisionPrimitive(zeus::CVector3f::skZero);
actor.MoveCollisionPrimitive(zeus::skZero3f);
if (f1 > 0.5f)
actor.SetNumTicksPartialUpdate(actor.GetNumTicksPartialUpdate() + 1);

View File

@ -21,19 +21,19 @@ CJointCollisionDescription CJointCollisionDescription::SphereSubdivideCollision(
float radius, float maxSeparation,
EOrientationType orientType,
std::string_view name, float mass) {
return CJointCollisionDescription(ECollisionType::SphereSubdivide, pivotId, nextId, zeus::CVector3f::skZero,
zeus::CVector3f::skZero, radius, maxSeparation, orientType, name, mass);
return CJointCollisionDescription(ECollisionType::SphereSubdivide, pivotId, nextId, zeus::skZero3f,
zeus::skZero3f, radius, maxSeparation, orientType, name, mass);
}
CJointCollisionDescription CJointCollisionDescription::SphereCollision(CSegId pivotId, float radius,
std::string_view name, float mass) {
return CJointCollisionDescription(ECollisionType::Sphere, pivotId, {}, zeus::CVector3f::skZero,
zeus::CVector3f::skZero, radius, 0.f, EOrientationType::Zero, name, mass);
return CJointCollisionDescription(ECollisionType::Sphere, pivotId, {}, zeus::skZero3f,
zeus::skZero3f, radius, 0.f, EOrientationType::Zero, name, mass);
}
CJointCollisionDescription CJointCollisionDescription::AABoxCollision(CSegId pivotId, const zeus::CVector3f& bounds,
std::string_view name, float mass) {
return CJointCollisionDescription(ECollisionType::AABox, pivotId, {}, bounds, zeus::CVector3f::skZero, 0.f, 0.f,
return CJointCollisionDescription(ECollisionType::AABox, pivotId, {}, bounds, zeus::skZero3f, 0.f, 0.f,
EOrientationType::Zero, name, mass);
}
@ -41,7 +41,7 @@ CJointCollisionDescription CJointCollisionDescription::OBBAutoSizeCollision(CSeg
const zeus::CVector3f& bounds,
EOrientationType orientType,
std::string_view name, float mass) {
return CJointCollisionDescription(ECollisionType::OBBAutoSize, pivotId, nextId, bounds, zeus::CVector3f::skZero, 0.f,
return CJointCollisionDescription(ECollisionType::OBBAutoSize, pivotId, nextId, bounds, zeus::skZero3f, 0.f,
0.f, orientType, name, mass);
}

View File

@ -152,7 +152,7 @@ CMovingAABoxComponents::CMovingAABoxComponents(const zeus::CAABox& aabb, const z
x6c4_vertIdxs.push_back(i);
if (useFaces == 1) {
x6e8_aabb = zeus::CAABox::skInvertedBox;
x6e8_aabb = zeus::CAABox();
x6e8_aabb.accumulateBounds(aabb.getPoint(x6c4_vertIdxs[0]));
x6e8_aabb.accumulateBounds(aabb.getPoint(x6c4_vertIdxs[1]));
x6e8_aabb.accumulateBounds(aabb.getPoint(x6c4_vertIdxs[2]));
@ -353,12 +353,12 @@ bool CMetroidAreaCollider::AABoxCollisionCheck_Cached(const COctreeLeafCache& le
const CMaterialFilter& filter, const CMaterialList& matList,
CCollisionInfoList& list) {
bool ret = false;
zeus::CPlane planes[] = {{zeus::CVector3f::skRight, aabb.min.dot(zeus::CVector3f::skRight)},
{zeus::CVector3f::skLeft, aabb.max.dot(zeus::CVector3f::skLeft)},
{zeus::CVector3f::skForward, aabb.min.dot(zeus::CVector3f::skForward)},
{zeus::CVector3f::skBack, aabb.max.dot(zeus::CVector3f::skBack)},
{zeus::CVector3f::skUp, aabb.min.dot(zeus::CVector3f::skUp)},
{zeus::CVector3f::skDown, aabb.max.dot(zeus::CVector3f::skDown)}};
zeus::CPlane planes[] = {{zeus::skRight, aabb.min.dot(zeus::skRight)},
{zeus::skLeft, aabb.max.dot(zeus::skLeft)},
{zeus::skForward, aabb.min.dot(zeus::skForward)},
{zeus::skBack, aabb.max.dot(zeus::skBack)},
{zeus::skUp, aabb.min.dot(zeus::skUp)},
{zeus::skDown, aabb.max.dot(zeus::skDown)}};
CAABoxAreaCache cache(aabb, planes, filter, matList, list);
ResetInternalCounters();
@ -378,7 +378,7 @@ bool CMetroidAreaCollider::AABoxCollisionCheck_Cached(const COctreeLeafCache& le
if (cache.x8_filter.Passes(material)) {
if (CollisionUtil::TriBoxOverlap(cache.x14_center, cache.x20_halfExtent, surf.GetVert(0), surf.GetVert(1),
surf.GetVert(2))) {
zeus::CAABox aabb = zeus::CAABox::skInvertedBox;
zeus::CAABox aabb = zeus::CAABox();
if (ConvexPolyCollision(cache.x4_planes, surf.GetVerts(), aabb)) {
zeus::CPlane plane = surf.GetPlane();
CCollisionInfo collision(aabb, cache.xc_material, material, plane.normal(), -plane.normal());
@ -424,7 +424,7 @@ bool CMetroidAreaCollider::AABoxCollisionCheck_Internal(const CAreaOctTree::Node
if (cache.x8_filter.Passes(material)) {
if (CollisionUtil::TriBoxOverlap(cache.x14_center, cache.x20_halfExtent, surf.GetVert(0), surf.GetVert(1),
surf.GetVert(2))) {
zeus::CAABox aabb = zeus::CAABox::skInvertedBox;
zeus::CAABox aabb = zeus::CAABox();
if (ConvexPolyCollision(cache.x4_planes, surf.GetVerts(), aabb)) {
zeus::CPlane plane = surf.GetPlane();
CCollisionInfo collision(aabb, cache.xc_material, material, plane.normal(), -plane.normal());
@ -447,12 +447,12 @@ bool CMetroidAreaCollider::AABoxCollisionCheck_Internal(const CAreaOctTree::Node
bool CMetroidAreaCollider::AABoxCollisionCheck(const CAreaOctTree& octTree, const zeus::CAABox& aabb,
const CMaterialFilter& filter, const CMaterialList& matList,
CCollisionInfoList& list) {
zeus::CPlane planes[] = {{zeus::CVector3f::skRight, aabb.min.dot(zeus::CVector3f::skRight)},
{zeus::CVector3f::skLeft, aabb.max.dot(zeus::CVector3f::skLeft)},
{zeus::CVector3f::skForward, aabb.min.dot(zeus::CVector3f::skForward)},
{zeus::CVector3f::skBack, aabb.max.dot(zeus::CVector3f::skBack)},
{zeus::CVector3f::skUp, aabb.min.dot(zeus::CVector3f::skUp)},
{zeus::CVector3f::skDown, aabb.max.dot(zeus::CVector3f::skDown)}};
zeus::CPlane planes[] = {{zeus::skRight, aabb.min.dot(zeus::skRight)},
{zeus::skLeft, aabb.max.dot(zeus::skLeft)},
{zeus::skForward, aabb.min.dot(zeus::skForward)},
{zeus::skBack, aabb.max.dot(zeus::skBack)},
{zeus::skUp, aabb.min.dot(zeus::skUp)},
{zeus::skDown, aabb.max.dot(zeus::skDown)}};
CAABoxAreaCache cache(aabb, planes, filter, matList, list);
ResetInternalCounters();

View File

@ -118,12 +118,12 @@ CCollisionSurface COBBTree::GetTransformedSurface(u16 idx, const zeus::CTransfor
xf * x18_indexData.x60_vertices[vert3], mat);
}
zeus::CAABox COBBTree::CalculateLocalAABox() const { return CalculateAABox(zeus::CTransform::Identity()); }
zeus::CAABox COBBTree::CalculateLocalAABox() const { return CalculateAABox(zeus::CTransform()); }
zeus::CAABox COBBTree::CalculateAABox(const zeus::CTransform& xf) const {
if (x88_root)
return x88_root->GetOBB().calculateAABox(xf);
return zeus::CAABox::skInvertedBox;
return zeus::CAABox();
}
COBBTree::SIndexData::SIndexData(CInputStream& in) {

View File

@ -115,7 +115,7 @@ u32 RayAABoxIntersection(const zeus::CMRay& ray, const zeus::CAABox& aabb, zeus:
}
d = maxComp;
norm = zeus::CVector3f::skZero;
norm = zeus::skZero3f;
norm[maxCompIdx] = (sign[maxCompIdx] == 1) ? -1.f : 1.f;
return 2;
}
@ -195,7 +195,7 @@ u32 RayAABoxIntersection_Double(const zeus::CMRay& ray, const zeus::CAABox& aabb
}
d = maxComp;
norm = zeus::CVector3f::skZero;
norm = zeus::skZero3f;
norm[maxCompIdx] = (sign[maxCompIdx] == 1) ? -1.0 : 1.0;
return 2;
}
@ -1059,7 +1059,7 @@ bool AABox_AABox_Moving(const zeus::CAABox& aabb0, const zeus::CAABox& aabb1, co
return false;
d = vecMin[maxAxis];
normal = zeus::CVector3f::skZero;
normal = zeus::skZero3f;
normal[maxAxis] = dir[maxAxis] > 0.f ? -1.f : 1.f;
for (int i = 0; i < 3; ++i)

View File

@ -371,15 +371,15 @@ void CBooRenderer::RenderFogVolumeModel(const zeus::CAABox& aabb, const CModel*
if (pass == 0) {
zeus::CAABox xfAABB = aabb.getTransformedAABox(modelMtx);
zeus::CUnitVector3f viewNormal(viewMtx.basis[1]);
zeus::CPlane planes[7] = {{zeus::CVector3f::skRight, xfAABB.min.x()},
{zeus::CVector3f::skLeft, -xfAABB.max.x()},
{zeus::CVector3f::skForward, xfAABB.min.y()},
{zeus::CVector3f::skBack, -xfAABB.max.y()},
{zeus::CVector3f::skUp, xfAABB.min.z()},
{zeus::CVector3f::skDown, -xfAABB.max.z()},
zeus::CPlane planes[7] = {{zeus::skRight, xfAABB.min.x()},
{zeus::skLeft, -xfAABB.max.x()},
{zeus::skForward, xfAABB.min.y()},
{zeus::skBack, -xfAABB.max.y()},
{zeus::skUp, xfAABB.min.z()},
{zeus::skDown, -xfAABB.max.z()},
{viewNormal, viewNormal.dot(viewMtx.origin) + 0.2f + 0.1f}};
CGraphics::SetModelMatrix(zeus::CTransform::Identity());
CGraphics::SetModelMatrix(zeus::CTransform());
float longestAxis = std::max(std::max(xfAABB.max.x() - xfAABB.min.x(), xfAABB.max.y() - xfAABB.min.y()),
xfAABB.max.z() - xfAABB.min.z()) *
@ -424,7 +424,7 @@ void CBooRenderer::RenderFogVolumeModel(const zeus::CAABox& aabb, const CModel*
}
void CBooRenderer::SetupRendererStates() const {
CGraphics::SetModelMatrix(zeus::CTransform::Identity());
CGraphics::SetModelMatrix(zeus::CTransform());
CGraphics::g_ColorRegs[1] = x2fc_tevReg1Color;
}
@ -634,6 +634,7 @@ CBooRenderer::CBooRenderer(IObjectStore& store, IFactory& resFac)
} BooTrace);
LoadThermoPalette();
LoadBallFade();
m_thermColdFilter.emplace();
m_thermHotFilter.emplace();
Buckets::Init();
@ -696,7 +697,7 @@ void CBooRenderer::UpdateAreaUniforms(int areaIdx, bool shadowRender, bool activ
int bufIdx;
if (shadowRender) {
flags.m_extendedShader = EExtendedShader::SolidColor;
flags.x4_color = zeus::CColor::skBlack;
flags.x4_color = zeus::skBlack;
bufIdx = 1;
} else {
flags.m_extendedShader = EExtendedShader::Lighting;
@ -913,7 +914,7 @@ void CBooRenderer::AddPlaneObject(const void* obj, const zeus::CAABox& aabb, con
float closeDist = xb0_viewPlane.pointToPlaneDist(closePoint);
float farDist = xb0_viewPlane.pointToPlaneDist(farPoint);
if (closeDist >= 0.f || farDist >= 0.f) {
bool zOnly = plane.normal() == zeus::CVector3f::skUp;
bool zOnly = plane.normal() == zeus::skUp;
bool invert;
if (zOnly)
invert = CGraphics::g_ViewMatrix.origin.z() >= plane.d();
@ -956,8 +957,8 @@ std::pair<zeus::CVector2f, zeus::CVector2f> CBooRenderer::SetViewportOrtho(bool
float right = centered ? g_Viewport.x4_top + g_Viewport.x10_halfWidth : g_Viewport.x8_width;
CGraphics::SetOrtho(left, right, top, bottom, znear, zfar);
CGraphics::SetViewPointMatrix(zeus::CTransform::Identity());
CGraphics::SetModelMatrix(zeus::CTransform::Identity());
CGraphics::SetViewPointMatrix(zeus::CTransform());
CGraphics::SetModelMatrix(zeus::CTransform());
return {{left, bottom}, {right, top}};
}
@ -974,7 +975,7 @@ void CBooRenderer::SetDebugOption(EDebugOption, int) {}
void CBooRenderer::BeginScene() {
CGraphics::SetViewport(0, 0, g_Viewport.x8_width, g_Viewport.xc_height);
CGraphics::SetPerspective(75.f, CGraphics::g_ProjAspect, 1.f, 4096.f);
CGraphics::SetModelMatrix(zeus::CTransform::Identity());
CGraphics::SetModelMatrix(zeus::CTransform());
#if 0
if (x310_phazonSuitMaskCountdown != 0)
{
@ -1090,8 +1091,8 @@ void CBooRenderer::SetThermal(bool thermal, float level, const zeus::CColor& col
void CBooRenderer::SetThermalColdScale(float scale) { x2f8_thermColdScale = zeus::clamp(0.f, scale, 1.f); }
void CBooRenderer::DoThermalBlendCold() {
zeus::CColor a = zeus::CColor::lerp(x2f4_thermColor, zeus::CColor::skWhite, x2f8_thermColdScale);
m_thermColdFilter.setColorA(a);
zeus::CColor a = zeus::CColor::lerp(x2f4_thermColor, zeus::skWhite, x2f8_thermColdScale);
m_thermColdFilter->setColorA(a);
float bFac = 0.f;
float bAlpha = 1.f;
if (x2f8_thermColdScale < 0.5f) {
@ -1099,15 +1100,15 @@ void CBooRenderer::DoThermalBlendCold() {
bFac = (1.f - bAlpha) / 8.f;
}
zeus::CColor b{bFac, bFac, bFac, bAlpha};
m_thermColdFilter.setColorB(b);
zeus::CColor c = zeus::CColor::lerp(zeus::CColor::skBlack, zeus::CColor::skWhite,
m_thermColdFilter->setColorB(b);
zeus::CColor c = zeus::CColor::lerp(zeus::skBlack, zeus::skWhite,
zeus::clamp(0.f, (x2f8_thermColdScale - 0.25f) * 4.f / 3.f, 1.f));
m_thermColdFilter.setColorC(c);
m_thermColdFilter->setColorC(c);
m_thermColdFilter.setScale(x2f8_thermColdScale);
m_thermColdFilter->setScale(x2f8_thermColdScale);
m_thermColdFilter.setShift(x2a8_thermalRand.Next() % 32);
m_thermColdFilter.draw();
m_thermColdFilter->setNoiseOffset(x2a8_thermalRand.Next() % 32);
m_thermColdFilter->draw();
CElementGen::SetMoveRedToAlphaBuffer(true);
CDecal::SetMoveRedToAlphaBuffer(true);
}
@ -1169,7 +1170,7 @@ void CBooRenderer::DrawPhazonSuitIndirectEffect(const zeus::CColor& nonIndirectM
/* Draw effect; subtracting binding 1 from binding 2 for the filter 'cutout' */
if (indTex && indTex.IsLoaded())
ReallyDrawPhazonSuitIndirectEffect(zeus::CColor::skWhite, *indTex, indirectMod, scale, offX, offY);
ReallyDrawPhazonSuitIndirectEffect(zeus::skWhite, *indTex, indirectMod, scale, offX, offY);
else
ReallyDrawPhazonSuitEffect(nonIndirectMod);
}

View File

@ -132,7 +132,7 @@ class CBooRenderer final : public IRenderer {
std::list<CFogVolumeFilter>::iterator m_nextFogVolumeFilter;
std::list<std::pair<zeus::CVector3f, float>> x2c4_spaceWarps;
u32 x2dc_reflectionAge = 2;
zeus::CColor x2e0_ = zeus::CColor::skWhite;
zeus::CColor x2e0_ = zeus::skWhite;
zeus::CVector3f x2e4_ = {0.f, 1.f, 0.f};
CSpaceWarpFilter m_spaceWarpFilter;
@ -141,7 +141,7 @@ class CBooRenderer final : public IRenderer {
zeus::CColor x2f4_thermColor;
float x2f8_thermColdScale = 0.f;
zeus::CColor x2fc_tevReg1Color = {1.f, 0.f, 1.f, 1.f};
CThermalColdFilter m_thermColdFilter;
rstl::optional<CThermalColdFilter> m_thermColdFilter;
rstl::optional<CThermalHotFilter> m_thermHotFilter;
std::vector<CLight> x300_dynamicLights;
@ -292,6 +292,8 @@ public:
int DrawOverlappingWorldModelIDs(int alphaVal, const std::vector<u32>& modelBits, const zeus::CAABox& aabb) const;
void DrawOverlappingWorldModelShadows(int alphaVal, const std::vector<u32>& modelBits, const zeus::CAABox& aabb,
float alpha) const;
bool IsThermalVisorActive() const { return x318_29_thermalVisor; }
};
} // namespace urde

View File

@ -21,7 +21,7 @@ ERglLightBits CGraphics::g_LightActive = ERglLightBits::None;
ERglLightBits CGraphics::g_LightsWereOn = ERglLightBits::None;
zeus::CTransform CGraphics::g_GXModelView;
zeus::CTransform CGraphics::g_GXModelViewInvXpose;
zeus::CTransform CGraphics::g_GXModelMatrix = zeus::CTransform::Identity();
zeus::CTransform CGraphics::g_GXModelMatrix = zeus::CTransform();
zeus::CTransform CGraphics::g_ViewMatrix;
zeus::CVector3f CGraphics::g_ViewPoint;
zeus::CTransform CGraphics::g_GXViewPointMatrix;

View File

@ -22,8 +22,8 @@ class CLight {
friend class CGameLight;
zeus::CVector3f x0_pos;
zeus::CVector3f xc_dir = zeus::CVector3f::skDown;
zeus::CColor x18_color = zeus::CColor::skClear;
zeus::CVector3f xc_dir = zeus::skDown;
zeus::CColor x18_color = zeus::skClear;
ELightType x1c_type = ELightType::Custom;
float x20_spotCutoff = 0.f;
float x24_distC = 1.f;

View File

@ -368,14 +368,18 @@ void CLineRenderer::Render(const zeus::CColor& moduColor) {
m_uniformBuf.access() = SDrawUniform{moduColor};
if (m_textured) {
memmove(m_vertBufTex.access(), g_StaticLineVertsTex.data(), sizeof(SDrawVertTex) * g_StaticLineVertsTex.size());
CGraphics::SetShaderDataBinding(m_shaderBind);
CGraphics::DrawArray(0, g_StaticLineVertsTex.size());
if (!g_StaticLineVertsTex.empty()) {
memmove(m_vertBufTex.access(), g_StaticLineVertsTex.data(), sizeof(SDrawVertTex) * g_StaticLineVertsTex.size());
CGraphics::SetShaderDataBinding(m_shaderBind);
CGraphics::DrawArray(0, g_StaticLineVertsTex.size());
}
} else {
memmove(m_vertBufNoTex.access(), g_StaticLineVertsNoTex.data(),
sizeof(SDrawVertNoTex) * g_StaticLineVertsNoTex.size());
CGraphics::SetShaderDataBinding(m_shaderBind);
CGraphics::DrawArray(0, g_StaticLineVertsNoTex.size());
if (!g_StaticLineVertsNoTex.empty()) {
memmove(m_vertBufNoTex.access(), g_StaticLineVertsNoTex.data(),
sizeof(SDrawVertNoTex) * g_StaticLineVertsNoTex.size());
CGraphics::SetShaderDataBinding(m_shaderBind);
CGraphics::DrawArray(0, g_StaticLineVertsNoTex.size());
}
}
}

View File

@ -71,8 +71,8 @@ public:
void Reset();
void AddVertex(const zeus::CVector3f& position, const zeus::CColor& color, float width,
const zeus::CVector2f& uv = zeus::CVector2f::skZero);
void Render(const zeus::CColor& moduColor = zeus::CColor::skWhite);
const zeus::CVector2f& uv = zeus::skZero2f);
void Render(const zeus::CColor& moduColor = zeus::skWhite);
static void UpdateBuffers() {
s_vertPoolTex.updateBuffers();

View File

@ -28,7 +28,7 @@ struct CModelFlags {
bool m_depthGreater = false;
u16 x2_flags = 0; /* Flags */
zeus::CColor x4_color; /* Set into kcolor slot specified by material */
zeus::CColor addColor = zeus::CColor::skClear;
zeus::CColor addColor = zeus::skClear;
zeus::CAABox mbShadowBox;
CModelFlags() = default;

View File

@ -95,11 +95,11 @@ void CBooModel::EnsureViewDepStateCached(const CBooModel& model, const CBooSurfa
/* Reflection map matrix */
zeus::CVector3f v1 = playerToSurf * (1.f / surfSize);
zeus::CVector3f v2 = v1.cross(zeus::CVector3f::skUp);
zeus::CVector3f v2 = v1.cross(zeus::skUp);
if (v2.canBeNormalized())
v2.normalize();
else
v2 = zeus::CVector3f::skRight;
v2 = zeus::skRight;
float timeScale = 0.32258067f * (0.02f * distance + 1.f);
float f1 = timeScale * g_TransformedTime;
@ -407,11 +407,11 @@ void CBooModel::MakeTexturesFromMats(std::vector<TCachedToken<CTexture>>& toksOu
void CBooModel::ActivateLights(const std::vector<CLight>& lights) { m_lightingData.ActivateLights(lights); }
void CBooModel::DisableAllLights() {
m_lightingData.ambient = zeus::CColor::skBlack;
m_lightingData.ambient = zeus::skBlack;
for (size_t curLight = 0; curLight < URDE_MAX_LIGHTS; ++curLight) {
CModelShaders::Light& lightOut = m_lightingData.lights[curLight];
lightOut.color = zeus::CColor::skClear;
lightOut.color = zeus::skClear;
lightOut.linAtt[0] = 1.f;
lightOut.angAtt[0] = 1.f;
}
@ -529,6 +529,9 @@ static EExtendedShader ResolveExtendedShader(const MaterialSet::Material& data,
EExtendedShader extended = EExtendedShader::Flat;
if (flags.m_extendedShader == EExtendedShader::Lighting) {
/* Transform lighting into thermal cold if the thermal visor is active */
if (g_Renderer->IsThermalVisorActive())
return EExtendedShader::ThermalCold;
if (data.heclIr.m_blendSrc == boo::BlendFactor::One && data.heclIr.m_blendDst == boo::BlendFactor::Zero) {
/* Override shader if originally opaque (typical for FRME models) */
if (flags.x0_blendMode > 6) {
@ -630,58 +633,58 @@ void CBooModel::UVAnimationBuffer::ProcessAnimation(u8*& bufOut, const UVAnimati
switch (anim.mode) {
case UVAnimation::Mode::MvInvNoTranslation: {
texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f();
texMtxOut.m[3].w() = 1.f;
postMtxOut.m[0].x() = 0.5f;
postMtxOut.m[1].y() = 0.5f;
postMtxOut.m[3].x() = 0.5f;
postMtxOut.m[3].y() = 0.5f;
texMtxOut[3].w() = 1.f;
postMtxOut[0].x() = 0.5f;
postMtxOut[1].y() = 0.5f;
postMtxOut[3].x() = 0.5f;
postMtxOut[3].y() = 0.5f;
break;
}
case UVAnimation::Mode::MvInv: {
texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f();
texMtxOut.m[3] = CGraphics::g_ViewMatrix.inverse() * CGraphics::g_GXModelMatrix.origin;
texMtxOut.m[3].w() = 1.f;
postMtxOut.m[0].x() = 0.5f;
postMtxOut.m[1].y() = 0.5f;
postMtxOut.m[3].x() = 0.5f;
postMtxOut.m[3].y() = 0.5f;
texMtxOut[3] = CGraphics::g_ViewMatrix.inverse() * CGraphics::g_GXModelMatrix.origin;
texMtxOut[3].w() = 1.f;
postMtxOut[0].x() = 0.5f;
postMtxOut[1].y() = 0.5f;
postMtxOut[3].x() = 0.5f;
postMtxOut[3].y() = 0.5f;
break;
}
case UVAnimation::Mode::Scroll: {
texMtxOut.m[3].x() = CGraphics::GetSecondsMod900() * anim.vals[2] + anim.vals[0];
texMtxOut.m[3].y() = CGraphics::GetSecondsMod900() * anim.vals[3] + anim.vals[1];
texMtxOut[3].x() = CGraphics::GetSecondsMod900() * anim.vals[2] + anim.vals[0];
texMtxOut[3].y() = CGraphics::GetSecondsMod900() * anim.vals[3] + anim.vals[1];
break;
}
case UVAnimation::Mode::Rotation: {
float angle = CGraphics::GetSecondsMod900() * anim.vals[1] + anim.vals[0];
float acos = std::cos(angle);
float asin = std::sin(angle);
texMtxOut.m[0].x() = acos;
texMtxOut.m[0].y() = asin;
texMtxOut.m[1].x() = -asin;
texMtxOut.m[1].y() = acos;
texMtxOut.m[3].x() = (1.0f - (acos - asin)) * 0.5f;
texMtxOut.m[3].y() = (1.0f - (asin + acos)) * 0.5f;
texMtxOut[0].x() = acos;
texMtxOut[0].y() = asin;
texMtxOut[1].x() = -asin;
texMtxOut[1].y() = acos;
texMtxOut[3].x() = (1.0f - (acos - asin)) * 0.5f;
texMtxOut[3].y() = (1.0f - (asin + acos)) * 0.5f;
break;
}
case UVAnimation::Mode::HStrip: {
float value = anim.vals[0] * anim.vals[2] * (anim.vals[3] + CGraphics::GetSecondsMod900());
texMtxOut.m[3].x() = std::trunc(anim.vals[1] * fmod(value, 1.0f)) * anim.vals[2];
texMtxOut[3].x() = std::trunc(anim.vals[1] * fmod(value, 1.0f)) * anim.vals[2];
break;
}
case UVAnimation::Mode::VStrip: {
float value = anim.vals[0] * anim.vals[2] * (anim.vals[3] + CGraphics::GetSecondsMod900());
texMtxOut.m[3].y() = std::trunc(anim.vals[1] * fmod(value, 1.0f)) * anim.vals[2];
texMtxOut[3].y() = std::trunc(anim.vals[1] * fmod(value, 1.0f)) * anim.vals[2];
break;
}
case UVAnimation::Mode::Model: {
texMtxOut = CGraphics::g_GXModelMatrix.toMatrix4f();
texMtxOut.m[3].zeroOut();
postMtxOut.m[0].x() = 0.5f;
postMtxOut.m[1].y() = 0.f;
postMtxOut.m[2].y() = 0.5f;
postMtxOut.m[3].x() = CGraphics::g_GXModelMatrix.origin.x() * 0.05f;
postMtxOut.m[3].y() = CGraphics::g_GXModelMatrix.origin.y() * 0.05f;
texMtxOut[3].zeroOut();
postMtxOut[0].x() = 0.5f;
postMtxOut[1].y() = 0.f;
postMtxOut[2].y() = 0.5f;
postMtxOut[3].x() = CGraphics::g_GXModelMatrix.origin.x() * 0.05f;
postMtxOut[3].y() = CGraphics::g_GXModelMatrix.origin.y() * 0.05f;
break;
}
case UVAnimation::Mode::CylinderEnvironment: {
@ -770,18 +773,16 @@ void CBooModel::UVAnimationBuffer::Update(u8*& bufOut, const MaterialSet* matSet
/* Special Mode0 matrix for exclusive Thermal Visor use */
specialMtxOut.emplace();
/* This part handled in-shader
zeus::CMatrix4f& texMtxOut = (*specialMtxOut)[0];
texMtxOut = CGraphics::g_GXModelViewInvXpose.toMatrix4f();
texMtxOut.vec[3].zeroOut();
texMtxOut.vec[3].w = 1.f;
*/
texMtxOut[3].zeroOut();
texMtxOut[3].w() = 1.f;
zeus::CMatrix4f& postMtxOut = (*specialMtxOut)[1];
postMtxOut.m[0].x() = 0.5f;
postMtxOut.m[1].y() = 0.5f;
postMtxOut.m[3].x() = 0.5f;
postMtxOut.m[3].y() = 0.5f;
postMtxOut[0].x() = 0.5f;
postMtxOut[1].y() = 0.5f;
postMtxOut[3].x() = 0.5f;
postMtxOut[3].y() = 0.5f;
} else if (flags.m_extendedShader == EExtendedShader::WorldShadow) {
/* Special matrix for mapping world shadow */
specialMtxOut.emplace();
@ -830,7 +831,7 @@ void GeometryUniformLayout::Update(const CModelFlags& flags, const CSkinRules* c
for (size_t w = 0; w < weightCount; ++w) {
zeus::CMatrix4f& obj = reinterpret_cast<zeus::CMatrix4f&>(*dataCur);
if (w >= bankTransforms.size())
obj = zeus::CMatrix4f::skIdentityMatrix4f;
obj = zeus::CMatrix4f();
else
obj = bankTransforms[w]->toMatrix4f();
dataCur += sizeof(zeus::CMatrix4f);
@ -838,7 +839,7 @@ void GeometryUniformLayout::Update(const CModelFlags& flags, const CSkinRules* c
for (size_t w = 0; w < weightCount; ++w) {
zeus::CMatrix4f& objInv = reinterpret_cast<zeus::CMatrix4f&>(*dataCur);
if (w >= bankTransforms.size())
objInv = zeus::CMatrix4f::skIdentityMatrix4f;
objInv = zeus::CMatrix4f();
else
objInv = bankTransforms[w]->basis;
dataCur += sizeof(zeus::CMatrix4f);
@ -848,12 +849,12 @@ void GeometryUniformLayout::Update(const CModelFlags& flags, const CSkinRules* c
} else {
for (size_t w = 0; w < weightCount; ++w) {
zeus::CMatrix4f& mv = reinterpret_cast<zeus::CMatrix4f&>(*dataCur);
mv = zeus::CMatrix4f::skIdentityMatrix4f;
mv = zeus::CMatrix4f();
dataCur += sizeof(zeus::CMatrix4f);
}
for (size_t w = 0; w < weightCount; ++w) {
zeus::CMatrix4f& mvinv = reinterpret_cast<zeus::CMatrix4f&>(*dataCur);
mvinv = zeus::CMatrix4f::skIdentityMatrix4f;
mvinv = zeus::CMatrix4f();
dataCur += sizeof(zeus::CMatrix4f);
}
}
@ -947,7 +948,7 @@ boo::ObjToken<boo::IGraphicsBufferD> CBooModel::UpdateUniformData(const CModelFl
} else if (flags.m_extendedShader == EExtendedShader::MorphBallShadow) /* MorphBall shadow render */
{
CModelShaders::MBShadowUniform& shadowOut = *reinterpret_cast<CModelShaders::MBShadowUniform*>(dataCur);
shadowOut.shadowUp = CGraphics::g_GXModelView * zeus::CVector3f::skUp;
shadowOut.shadowUp = CGraphics::g_GXModelView * zeus::skUp;
shadowOut.shadowUp.w() = flags.x4_color.a();
shadowOut.shadowId = flags.x4_color.r();
} else if (flags.m_extendedShader == EExtendedShader::Disintegrate) {
@ -992,7 +993,7 @@ void CBooModel::DrawAlpha(const CModelFlags& flags, const CSkinRules* cskr, cons
/* Check if we're overriding with RenderModelBlack */
if (g_RenderModelBlack) {
rFlags.m_extendedShader = EExtendedShader::SolidColor;
rFlags.x4_color = zeus::CColor::skBlack;
rFlags.x4_color = zeus::skBlack;
}
if (TryLockTextures()) {
@ -1006,7 +1007,7 @@ void CBooModel::DrawNormal(const CModelFlags& flags, const CSkinRules* cskr, con
/* Check if we're overriding with RenderModelBlack */
if (g_RenderModelBlack) {
rFlags.m_extendedShader = EExtendedShader::SolidColor;
rFlags.x4_color = zeus::CColor::skBlack;
rFlags.x4_color = zeus::skBlack;
}
if (TryLockTextures()) {
UpdateUniformData(rFlags, cskr, pose);
@ -1019,7 +1020,7 @@ void CBooModel::Draw(const CModelFlags& flags, const CSkinRules* cskr, const CPo
/* Check if we're overriding with RenderModelBlack */
if (g_RenderModelBlack) {
rFlags.m_extendedShader = EExtendedShader::SolidColor;
rFlags.x4_color = zeus::CColor::skBlack;
rFlags.x4_color = zeus::skBlack;
}
if (TryLockTextures()) {
@ -1235,7 +1236,7 @@ void CModel::RestoreVerticesCPU(const boo::ObjToken<boo::IGraphicsBufferD>& vert
void CModel::_WarmupShaders() {
CBooModel::SetDummyTextures(true);
CBooModel::EnableShadowMaps(g_Renderer->x220_sphereRamp.get(), zeus::CTransform::Identity());
CBooModel::EnableShadowMaps(g_Renderer->x220_sphereRamp.get(), zeus::CTransform());
CGraphics::CProjectionState backupProj = CGraphics::GetProjectionState();
zeus::CTransform backupViewPoint = CGraphics::g_ViewMatrix;
zeus::CTransform backupModel = CGraphics::g_GXModelMatrix;

View File

@ -151,7 +151,7 @@ u32 CRainSplashGenerator::GetNextBestPt(u32 pt, const std::vector<std::pair<zeus
auto idx = u32(rand.Range(0, int(vn.size() - 1)));
auto& vert = vn[idx];
float distSq = (refVert.first - vert.first).magSquared();
if (distSq > maxDist && vert.second.dot(zeus::CVector3f::skUp) >= 0.f &&
if (distSq > maxDist && vert.second.dot(zeus::skUp) >= 0.f &&
(vert.first.z() <= 0.f || vert.first.z() > minZ)) {
nextPt = idx;
maxDist = distSq;

View File

@ -41,14 +41,14 @@ void CSimpleShadow::Render(const TLockedToken<CTexture>& tex) const {
{{radius, 0.f, -radius}, {0.f, 1.f}},
{{-radius, 0.f, radius}, {1.f, 0.f}},
{{radius, 0.f, radius}, {1.f, 1.f}}};
m_filter->drawVerts(zeus::CColor::skWhite, verts);
m_filter->drawVerts(zeus::skWhite, verts);
}
void CSimpleShadow::Calculate(const zeus::CAABox& aabb, const zeus::CTransform& xf, const CStateManager& mgr) {
x48_24_collision = false;
float halfHeight = (aabb.max.z() - aabb.min.z()) * 0.5f;
zeus::CVector3f pos = xf.origin + zeus::CVector3f(0.f, 0.f, halfHeight);
CRayCastResult res = mgr.RayStaticIntersection(pos, zeus::CVector3f::skDown, x40_maxObjHeight,
CRayCastResult res = mgr.RayStaticIntersection(pos, zeus::skDown, x40_maxObjHeight,
CMaterialFilter::MakeExclude({EMaterialTypes::SeeThrough}));
float height = x40_maxObjHeight;
if (res.IsValid()) {
@ -60,7 +60,7 @@ void CSimpleShadow::Calculate(const zeus::CAABox& aabb, const zeus::CTransform&
TUniqueId cid = kInvalidUniqueId;
rstl::reserved_vector<TUniqueId, 1024> nearList;
CRayCastResult resD = CGameCollision::RayDynamicIntersection(
mgr, cid, pos, zeus::CVector3f::skDown, x40_maxObjHeight, CMaterialFilter::skPassEverything, nearList);
mgr, cid, pos, zeus::skDown, x40_maxObjHeight, CMaterialFilter::skPassEverything, nearList);
if (resD.IsValid() && resD.GetT() < height) {
x48_24_collision = true;
height = resD.GetT();
@ -70,7 +70,7 @@ void CSimpleShadow::Calculate(const zeus::CAABox& aabb, const zeus::CTransform&
if (x48_24_collision) {
x3c_heightAlpha = 1.f - height / x40_maxObjHeight;
x0_xf = zeus::lookAt(res.GetPlane().normal(), zeus::CVector3f::skZero);
x0_xf = zeus::lookAt(res.GetPlane().normal(), zeus::skZero3f);
x0_xf.origin = res.GetPlane().normal() * x44_displacement + res.GetPoint();
if (x48_25_alwaysCalculateRadius || !x48_26_radiusCalculated) {
float xExtent = aabb.max.x() - aabb.min.x();

View File

@ -7,7 +7,7 @@ namespace urde {
std::unordered_map<uint64_t, CModelShaders::ShaderPipelines> CModelShaders::g_ShaderPipelines;
void CModelShaders::LightingUniform::ActivateLights(const std::vector<CLight>& lts) {
ambient = zeus::CColor::skClear;
ambient = zeus::skClear;
size_t curLight = 0;
for (const CLight& light : lts) {
@ -42,9 +42,9 @@ void CModelShaders::LightingUniform::ActivateLights(const std::vector<CLight>& l
for (; curLight < URDE_MAX_LIGHTS; ++curLight) {
CModelShaders::Light& lightOut = lights[curLight];
lightOut.pos = zeus::CVector3f::skZero;
lightOut.dir = zeus::CVector3f::skDown;
lightOut.color = zeus::CColor::skClear;
lightOut.pos = zeus::skZero3f;
lightOut.dir = zeus::skDown;
lightOut.color = zeus::skClear;
lightOut.linAtt[0] = 1.f;
lightOut.linAtt[1] = 0.f;
lightOut.linAtt[2] = 0.f;
@ -144,7 +144,11 @@ static hecl::Backend::ExtensionSlot g_ExtensionSlots[] = {
false, true, false, false, true},
/* Forced additive shading without culling or Z-write and greater depth test */
{1, BlockNames, 0, nullptr, hecl::Backend::BlendFactor::SrcAlpha, hecl::Backend::BlendFactor::One,
hecl::Backend::ZTest::Greater, hecl::Backend::CullMode::None, true, false, true}};
hecl::Backend::ZTest::Greater, hecl::Backend::CullMode::None, true, false, true},
/* Thermal cold shading */
{1, BlockNames, 0, nullptr, hecl::Backend::BlendFactor::Original, hecl::Backend::BlendFactor::Original,
hecl::Backend::ZTest::Original, hecl::Backend::CullMode::Original,
false, false, true, false, false, false, true}};
extern const hecl::Backend::Function ExtensionLightingFuncsGLSL[];
extern const hecl::Backend::Function ExtensionPostFuncsGLSL[];

View File

@ -35,6 +35,7 @@ enum EExtendedShader : uint8_t {
DepthGEqualNoZWrite,
Disintegrate,
ForcedAdditiveNoZWriteDepthGreater,
ThermalCold,
MAX
};
@ -45,7 +46,7 @@ public:
struct Light {
zeus::CVector3f pos;
zeus::CVector3f dir;
zeus::CColor color = zeus::CColor::skClear;
zeus::CColor color = zeus::skClear;
float linAtt[4] = {1.f, 0.f, 0.f};
float angAtt[4] = {1.f, 0.f, 0.f};
};

View File

@ -173,7 +173,7 @@ static std::string_view ThermalPostGLSL =
"};\n"
"vec4 ThermalPostFunc(vec4 colorIn)\n"
"{\n"
" return vec4(texture(extTex7, vtf.extTcgs[0]).rrr * tmulColor.rgb + taddColor.rgb, tmulColor.a + taddColor.a);\n"
" return texture(extTex7, vtf.extTcgs[0]).rrrr * tmulColor + taddColor;\n"
"}\n"
"\n"sv;
@ -221,6 +221,13 @@ static std::string_view DisintegratePostGLSL = FOG_STRUCT_GLSL
"}\n"
"\n"sv;
static std::string_view ThermalColdPostGLSL =
"vec4 ThermalColdPostFunc(vec4 colorIn)\n"
"{\n"
" return colorIn * vec4(0.75);\n"
"}\n"
"\n"sv;
const hecl::Backend::Function ExtensionLightingFuncsGLSL[] = {
{},
{LightingGLSL, "LightingFunc"},
@ -244,6 +251,7 @@ const hecl::Backend::Function ExtensionLightingFuncsGLSL[] = {
{LightingGLSL, "LightingFunc"},
{},
{LightingGLSL, "LightingFunc"},
{},
};
const hecl::Backend::Function ExtensionPostFuncsGLSL[] = {
@ -269,6 +277,7 @@ const hecl::Backend::Function ExtensionPostFuncsGLSL[] = {
{MainPostGLSL, "MainPostFunc"},
{DisintegratePostGLSL, "DisintegratePostFunc"},
{MainPostGLSL, "MainPostFunc"},
{ThermalColdPostGLSL, "ThermalColdPostFunc"},
};
} // namespace urde

View File

@ -166,8 +166,7 @@ static std::string_view ThermalPostHLSL =
"};\n"
"static float4 ThermalPostFunc(in VertToFrag vtf, float4 colorIn)\n"
"{\n"
" return float4(extTex7.Sample(samp, vtf.extTcgs[0]).rrr * tmulColor.rgb + taddColor.rgb, tmulColor.a + "
"taddColor.a);\n"
" return extTex7.Sample(samp, vtf.extTcgs[0]).rrrr * tmulColor + taddColor;\n"
"}\n"
"\n"sv;
@ -215,6 +214,13 @@ static std::string_view DisintegratePostHLSL = FOG_STRUCT_HLSL
"}\n"
"\n"sv;
static std::string_view ThermalColdPostHLSL =
"static float4 ThermalColdPostFunc(in VertToFrag vtf, float4 colorIn)\n"
"{\n"
" return colorIn * float4(0.75, 0.75, 0.75, 0.75);\n"
"}\n"
"\n"sv;
const hecl::Backend::Function ExtensionLightingFuncsHLSL[] = {{},
{LightingHLSL, "LightingFunc"},
{},
@ -236,7 +242,8 @@ const hecl::Backend::Function ExtensionLightingFuncsHLSL[] = {{},
{LightingHLSL, "LightingFunc"},
{LightingHLSL, "LightingFunc"},
{},
{LightingHLSL, "LightingFunc"}};
{LightingHLSL, "LightingFunc"},
{}};
const hecl::Backend::Function ExtensionPostFuncsHLSL[] = {
{},
@ -261,6 +268,7 @@ const hecl::Backend::Function ExtensionPostFuncsHLSL[] = {
{MainPostHLSL, "MainPostFunc"},
{DisintegratePostHLSL, "DisintegratePostFunc"},
{MainPostHLSL, "MainPostFunc"},
{ThermalColdPostHLSL, "ThermalColdPostFunc"},
};
} // namespace urde

View File

@ -168,9 +168,7 @@ static std::string_view ThermalPostMetal =
"static float4 EXTThermalPostFunc(thread VertToFrag& vtf, constant ThermalUniform& lu,\n"
" sampler samp, sampler clampSamp, texture2d<float> extTex7, float4 colorIn)\n"
"{\n"
" //return float4(vtf.extTcgs0.xy, 0.0, 1.0);\n"
" return float4(extTex7.sample(samp, vtf.extTcgs0).rrr * lu.tmulColor.rgb + lu.taddColor.rgb,\n"
" lu.tmulColor.a + lu.taddColor.a);\n"
" return extTex7.sample(samp, vtf.extTcgs0).rrrr * lu.tmulColor + lu.taddColor;\n"
"}\n"
"\n"sv;
@ -221,6 +219,13 @@ static std::string_view DisintegratePostMetal = FOG_STRUCT_METAL
"}\n"
"\n"sv;
static std::string_view ThermalColdPostMetal =
"static float4 ThermalColdPostFunc(thread VertToFrag& vtf, constant LightingUniform& lu, float4 colorIn)\n"
"{\n"
" return colorIn * float4(0.75, 0.75, 0.75, 0.75);\n"
"}\n"
"\n"sv;
const hecl::Backend::Function ExtensionLightingFuncsMetal[] = {{},
{LightingMetal, "LightingFunc"},
{},
@ -242,7 +247,8 @@ const hecl::Backend::Function ExtensionLightingFuncsMetal[] = {{},
{LightingMetal, "LightingFunc"},
{LightingMetal, "LightingFunc"},
{},
{LightingMetal, "LightingFunc"}};
{LightingMetal, "LightingFunc"},
{}};
const hecl::Backend::Function ExtensionPostFuncsMetal[] = {
{},
@ -267,6 +273,7 @@ const hecl::Backend::Function ExtensionPostFuncsMetal[] = {
{MainPostMetal, "MainPostFunc"},
{DisintegratePostMetal, "EXTDisintegratePostFunc"},
{MainPostMetal, "MainPostFunc"},
{ThermalColdPostMetal, "ThermalColdPostFunc"},
};
} // namespace urde

View File

@ -260,7 +260,7 @@ void CTexturedQuadFilter::drawVerts(const zeus::CColor& color, const Vert verts[
}
void CTexturedQuadFilter::DrawFilter(EFilterShape shape, const zeus::CColor& color, float t) {
m_uniform.m_matrix = zeus::CMatrix4f::skIdentityMatrix4f;
m_uniform.m_matrix = zeus::CMatrix4f();
m_uniform.m_lod = 0.f;
m_uniform.m_color = color;
m_uniBuf->load(&m_uniform, sizeof(m_uniform));

View File

@ -1,6 +1,8 @@
#include "CThermalColdFilter.hpp"
#include "Graphics/CGraphics.hpp"
#include "Graphics/CBooRenderer.hpp"
#include "hecl/Pipeline.hpp"
#include "GameGlobalObjects.hpp"
namespace urde {
@ -12,58 +14,34 @@ void CThermalColdFilter::Shutdown() { s_Pipeline.reset(); }
CThermalColdFilter::CThermalColdFilter() {
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
m_shiftTex = ctx.newDynamicTexture(8, 4, boo::TextureFormat::RGBA8, boo::TextureClampMode::Repeat);
struct Vert {
zeus::CVector2f m_pos;
zeus::CVector2f m_uv;
zeus::CVector2f m_uvNoise;
} verts[4] = {
{{-1.f, -1.f}, {0.f, 0.f}},
{{-1.f, 1.f}, {0.f, 1.f}},
{{1.f, -1.f}, {1.f, 0.f}},
{{1.f, 1.f}, {1.f, 1.f}},
{{-1.f, -1.f}, {0.f, 0.f}, {0.f, 0.f}},
{{-1.f, 1.f}, {0.f, 1.f}, {0.f, 448.f}},
{{1.f, -1.f}, {1.f, 0.f}, {640.f, 0.f}},
{{1.f, 1.f}, {1.f, 1.f}, {640.f, 448.f}},
};
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, verts, 32, 4);
m_vbo = ctx.newStaticBuffer(boo::BufferUse::Vertex, verts, 48, 4);
m_uniBuf = ctx.newDynamicBuffer(boo::BufferUse::Uniform, sizeof(Uniform), 1);
boo::ObjToken<boo::IGraphicsBuffer> bufs[] = {m_uniBuf.get()};
boo::PipelineStage stages[] = {boo::PipelineStage::Vertex};
boo::ObjToken<boo::ITexture> texs[] = {CGraphics::g_SpareTexture.get(), m_shiftTex.get()};
boo::ObjToken<boo::ITexture> texs[] = {CGraphics::g_SpareTexture.get(),
g_Renderer->GetRandomStaticEntropyTex()};
m_dataBind = ctx.newShaderDataBinding(s_Pipeline, m_vbo.get(), nullptr, nullptr, 1, bufs, stages, nullptr, nullptr,
2, texs, nullptr, nullptr);
return true;
} BooTrace);
setShift(0);
setNoiseOffset(0);
setScale(0.f);
}
void CThermalColdFilter::setShift(unsigned shift) {
shift = std::min(shift, 31u);
for (unsigned y = 0; y < 4; ++y) {
unsigned bx = y * 8;
for (unsigned x = 0; x < 8; ++x) {
unsigned px = bx + x;
unsigned spx = px + shift;
unsigned ny = spx / 8;
if (ny > 3)
ny = 3;
unsigned nx = spx % 8;
m_shiftTexture[y][x][0] = u8(nx * 255 / 7);
m_shiftTexture[y][x][1] = u8(ny * 255 / 3);
}
}
m_shiftTex->load(m_shiftTexture[0][0], sizeof(m_shiftTexture));
}
void CThermalColdFilter::draw() {
CGraphics::ResolveSpareTexture(CGraphics::g_CroppedViewport);
m_uniform.m_shiftTexMtx[0][0] = 80.f * (CGraphics::g_ProjAspect / 1.33f);
m_uniform.m_shiftTexMtx[1][1] = 120.f;
m_uniform.m_shiftTexScale[0] = 1.f / m_uniform.m_shiftTexMtx[0][0];
m_uniform.m_shiftTexScale[1] = 1.f / m_uniform.m_shiftTexMtx[1][1];
m_uniBuf->load(&m_uniform, sizeof(m_uniform));
CGraphics::SetShaderDataBinding(m_dataBind);
CGraphics::DrawArray(0, 4);
}

View File

@ -9,13 +9,10 @@ namespace urde {
class CThermalColdFilter {
struct Uniform {
zeus::CMatrix4f m_shiftTexMtx;
zeus::CMatrix4f m_indMtx;
zeus::CVector2f m_shiftTexScale;
zeus::CColor m_colorRegs[3];
float m_randOff = 0.f;
};
u8 m_shiftTexture[4][8][4] = {};
boo::ObjToken<boo::ITextureD> m_shiftTex;
boo::ObjToken<boo::IGraphicsBufferS> m_vbo;
boo::ObjToken<boo::IGraphicsBufferD> m_uniBuf;
boo::ObjToken<boo::IShaderDataBinding> m_dataBind;
@ -25,7 +22,7 @@ public:
static void Initialize();
static void Shutdown();
CThermalColdFilter();
void setShift(unsigned shift);
void setNoiseOffset(unsigned shift) { m_uniform.m_randOff = float(shift); }
void setColorA(const zeus::CColor& color) { m_uniform.m_colorRegs[0] = color; }
void setColorB(const zeus::CColor& color) { m_uniform.m_colorRegs[1] = color; }
void setColorC(const zeus::CColor& color) { m_uniform.m_colorRegs[2] = color; }

View File

@ -40,7 +40,7 @@ void CWorldShadowShader::drawBase(float extent) {
m_vbo->load(verts, sizeof(zeus::CVector3f) * 4);
m_uniform.m_matrix = CGraphics::GetPerspectiveProjectionMatrix(true) * CGraphics::g_GXModelView.toMatrix4f();
m_uniform.m_color = zeus::CColor::skWhite;
m_uniform.m_color = zeus::skWhite;
m_uniBuf->load(&m_uniform, sizeof(m_uniform));
CGraphics::SetShaderDataBinding(m_zDataBind);

View File

@ -35,7 +35,7 @@ std::shared_ptr<CGuiWidget> CAuiImagePane::Create(CGuiFrame* frame, CInputStream
void CAuiImagePane::Update(float dt) {
xd0_uvBias0.x() = std::fmod(xd0_uvBias0.x(), 1.f);
xd0_uvBias0.y() = std::fmod(xd0_uvBias0.y(), 1.f);
if (x138_tileSize != zeus::CVector2f::skZero && xb8_tex0Tok.IsLoaded()) {
if (x138_tileSize != zeus::skZero2f && xb8_tex0Tok.IsLoaded()) {
zeus::CVector2f tmp = zeus::CVector2f(xb8_tex0Tok->GetWidth(), xb8_tex0Tok->GetHeight()) / x138_tileSize;
x144_frameTimer = std::fmod(x144_frameTimer + dt * x140_interval, std::floor(tmp.x()) * std::floor(tmp.y()));
}
@ -57,7 +57,7 @@ void CAuiImagePane::DoDrawImagePane(const zeus::CColor& color, const CTexture& t
rstl::reserved_vector<zeus::CVector2f, 4> vec;
const rstl::reserved_vector<zeus::CVector2f, 4>* useUVs;
if (x138_tileSize != zeus::CVector2f::skZero) {
if (x138_tileSize != zeus::skZero2f) {
zeus::CVector2f res(xb8_tex0Tok->GetWidth(), xb8_tex0Tok->GetHeight());
zeus::CVector2f tmp = res / x138_tileSize;
zeus::CVector2f tmpRecip = x138_tileSize / res;

View File

@ -11,7 +11,7 @@
namespace urde {
const CTargetReticleRenderState CTargetReticleRenderState::skZeroRenderState(kInvalidUniqueId, 1.f,
zeus::CVector3f::skZero, 0.f, 1.f, true);
zeus::skZero3f, 0.f, 1.f, true);
static float offshoot_func(float f1, float f2, float f3) { return (f1 * 0.5f) + std::sin((f3 - 0.5f) * f2); }
@ -311,7 +311,7 @@ void CCompoundTargetReticle::UpdateCurrLockOnGroup(float dt, const CStateManager
if (xf0_targetId == kInvalidUniqueId)
x12c_currGroupA.SetTargetId(targetId);
x14c_currGroupB = CTargetReticleRenderState(
targetId, 1.f, zeus::CVector3f::skZero, 1.f,
targetId, 1.f, zeus::skZero3f, 1.f,
IsGrappleTarget(targetId, mgr) ? g_tweakTargeting->GetGrappleMinClampScale() : 1.f, false);
x16c_currGroupDur = xf0_targetId == kInvalidUniqueId ? g_tweakTargeting->GetCurrLockOnExitDuration()
: g_tweakTargeting->GetCurrLockOnSwitchDuration();
@ -381,7 +381,7 @@ void CCompoundTargetReticle::UpdateNextLockOnGroup(float dt, const CStateManager
} else {
x194_nextGroupA = x174_nextGroupInterp;
x1b4_nextGroupB = CTargetReticleRenderState(
nextTargetId, 1.f, zeus::CVector3f::skZero, 1.f,
nextTargetId, 1.f, zeus::skZero3f, 1.f,
IsGrappleTarget(nextTargetId, mgr) ? g_tweakTargeting->GetGrappleMinClampScale() : 1.f, true);
x1d4_nextGroupDur = x1d8_nextGroupTimer = xf2_nextTargetId == kInvalidUniqueId
? g_tweakTargeting->GetNextLockOnEnterDuration()
@ -511,7 +511,7 @@ void CCompoundTargetReticle::DrawCurrLockOnGroup(const zeus::CMatrix3f& rot, con
}
zeus::CMatrix3f lockBreakXf;
zeus::CColor lockBreakColor = zeus::CColor::skClear;
zeus::CColor lockBreakColor = zeus::skClear;
if (IsDamageOrbit(mgr.GetPlayer().GetOrbitRequest()) && x14c_currGroupB.GetFactor() == 0.f) {
zeus::CMatrix3f lockBreakRM;
for (int i = 0; i < 4; ++i) {

View File

@ -4,9 +4,9 @@
namespace urde {
CFontRenderState::CFontRenderState() {
x54_colors[0] = zeus::CColor::skWhite;
x54_colors[1] = zeus::CColor::skGrey;
x54_colors[2] = zeus::CColor::skWhite;
x54_colors[0] = zeus::skWhite;
x54_colors[1] = zeus::skGrey;
x54_colors[2] = zeus::skWhite;
RefreshPalette();
}

View File

@ -19,7 +19,7 @@ CGuiFrame::CGuiFrame(CAssetId id, CGuiSys& sys, int a, int b, int c, CSimplePool
x3c_lights.reserve(8);
m_indexedLights.reserve(8);
x10_rootWidget.reset(new CGuiWidget(CGuiWidget::CGuiWidgetParms(
this, false, 0, 0, false, false, false, zeus::CColor::skWhite, CGuiWidget::EGuiModelDrawFlags::Alpha, false,
this, false, 0, 0, false, false, false, zeus::skWhite, CGuiWidget::EGuiModelDrawFlags::Alpha, false,
x8_guiSys.x8_mode != CGuiSys::EUsageMode::Zero)));
x8_guiSys.m_registeredFrames.insert(this);
}
@ -47,7 +47,7 @@ void CGuiFrame::EnableLights(u32 lights, CBooModel& model) const {
lightsOut.reserve(m_indexedLights.size() + 1);
CGraphics::DisableAllLights();
zeus::CColor ambColor(zeus::CColor::skBlack);
zeus::CColor ambColor(zeus::skBlack);
ERglLight lightId = ERglLight::Zero;
int idx = 0;
for (CGuiLight* light : m_indexedLights) {
@ -71,11 +71,11 @@ void CGuiFrame::EnableLights(u32 lights, CBooModel& model) const {
++idx;
}
if (lightsOut.empty()) {
// CGraphics::SetAmbientColor(zeus::CColor::skWhite);
lightsOut.push_back(CLight::BuildLocalAmbient(zeus::CVector3f::skZero, zeus::CColor::skWhite));
// CGraphics::SetAmbientColor(zeus::skWhite);
lightsOut.push_back(CLight::BuildLocalAmbient(zeus::skZero3f, zeus::skWhite));
} else {
// CGraphics::SetAmbientColor(ambColor);
lightsOut.push_back(CLight::BuildLocalAmbient(zeus::CVector3f::skZero, ambColor));
lightsOut.push_back(CLight::BuildLocalAmbient(zeus::skZero3f, ambColor));
}
model.ActivateLights(lightsOut);
@ -128,7 +128,7 @@ void CGuiFrame::Update(float dt) { xc_headWidget->Update(dt); }
void CGuiFrame::Draw(const CGuiWidgetDrawParms& parms) const {
CGraphics::SetCullMode(ERglCullMode::None);
CGraphics::SetAmbientColor(zeus::CColor::skWhite);
CGraphics::SetAmbientColor(zeus::skWhite);
DisableLights();
x14_camera->Draw(parms);
// Set one-stage modulate

View File

@ -18,7 +18,7 @@ CGuiLight::CGuiLight(const CGuiWidgetParms& parms, const CLight& light)
CGuiLight::~CGuiLight() { xb0_frame->RemoveLight(this); }
CLight CGuiLight::BuildLight() const {
CLight ret = CLight::BuildLocalAmbient(zeus::CVector3f::skZero, zeus::CColor::skBlack);
CLight ret = CLight::BuildLocalAmbient(zeus::skZero3f, zeus::skBlack);
switch (xb8_type) {
case ELightType::Spot:
@ -63,7 +63,7 @@ std::shared_ptr<CGuiWidget> CGuiLight::Create(CGuiFrame* frame, CInputStream& in
switch (tp) {
case ELightType::Spot: {
float cutoff = in.readFloatBig();
CLight lt = CLight::BuildSpot(zeus::CVector3f::skZero, zeus::CVector3f::skZero, parms.x10_color, cutoff);
CLight lt = CLight::BuildSpot(zeus::skZero3f, zeus::skZero3f, parms.x10_color, cutoff);
lt.SetAttenuation(distC, distL, distQ);
lt.SetAngleAttenuation(angC, angL, angQ);
lt.x40_lightId = lightId;
@ -71,14 +71,14 @@ std::shared_ptr<CGuiWidget> CGuiLight::Create(CGuiFrame* frame, CInputStream& in
break;
}
case ELightType::Point: {
CLight lt = CLight::BuildPoint(zeus::CVector3f::skZero, parms.x10_color);
CLight lt = CLight::BuildPoint(zeus::skZero3f, parms.x10_color);
lt.SetAttenuation(distC, distL, distQ);
lt.x40_lightId = lightId;
ret = std::make_shared<CGuiLight>(parms, lt);
break;
}
case ELightType::Directional: {
CLight lt = CLight::BuildDirectional(zeus::CVector3f::skZero, parms.x10_color);
CLight lt = CLight::BuildDirectional(zeus::skZero3f, parms.x10_color);
lt.x40_lightId = lightId;
ret = std::make_shared<CGuiLight>(parms, lt);
break;

View File

@ -16,7 +16,7 @@ class CGuiLight : public CGuiWidget {
float xd0_angleL;
float xd4_angleQ;
u32 xd8_lightId;
zeus::CColor xdc_ambColor = zeus::CColor::skBlack;
zeus::CColor xdc_ambColor = zeus::skBlack;
public:
~CGuiLight();

View File

@ -50,7 +50,7 @@ void CGuiModel::Draw(const CGuiWidgetDrawParms& parms) const {
switch (xac_drawFlags) {
case EGuiModelDrawFlags::Shadeless: {
CModelFlags flags(0, 0, 3, zeus::CColor::skWhite);
CModelFlags flags(0, 0, 3, zeus::skWhite);
flags.m_extendedShader = EExtendedShader::Flat;
model->Draw(flags);
break;

View File

@ -30,7 +30,7 @@ void CGuiObject::MoveInWorld(const zeus::CVector3f& vec) {
void CGuiObject::SetLocalPosition(const zeus::CVector3f& pos) { MoveInWorld(pos - x4_localXF.origin); }
void CGuiObject::RotateReset() {
x4_localXF.basis = zeus::CMatrix3f::skIdentityMatrix3f;
x4_localXF.basis = zeus::CMatrix3f();
RecalculateTransforms();
}

View File

@ -88,7 +88,7 @@ void CGuiSys::ViewportResizeFrame(CGuiFrame* frame) {
if (g_Viewport.aspect > frame->m_maxAspect)
frame->m_aspectTransform = zeus::CTransform::Scale({frame->m_maxAspect / g_Viewport.aspect, 1.f, 1.f});
else
frame->m_aspectTransform = zeus::CTransform::Identity();
frame->m_aspectTransform = zeus::CTransform();
}
}

View File

@ -12,7 +12,7 @@ CGuiTextPane::CGuiTextPane(const CGuiWidgetParms& parms, CSimplePool* sp, const
const zeus::CVector3f& vec, CAssetId fontId, const CGuiTextProperties& props,
const zeus::CColor& fontCol, const zeus::CColor& outlineCol, s32 extentX, s32 extentY)
: CGuiPane(parms, dim, vec)
, xd4_textSupport(fontId, props, fontCol, outlineCol, zeus::CColor::skWhite, extentX, extentY, sp, xac_drawFlags) {}
, xd4_textSupport(fontId, props, fontCol, outlineCol, zeus::skWhite, extentX, extentY, sp, xac_drawFlags) {}
void CGuiTextPane::Update(float dt) {
CGuiWidget::Update(dt);

View File

@ -116,7 +116,7 @@ void CGuiWidget::SetIdlePosition(const zeus::CVector3f& pos, bool reapply) {
void CGuiWidget::ReapplyXform() {
RotateReset();
SetLocalPosition(zeus::CVector3f::skZero);
SetLocalPosition(zeus::skZero3f);
MultiplyO2P(x74_transform);
}

View File

@ -44,8 +44,8 @@ void CHudBallInterface::UpdatePowerBombReadoutColors() {
fontColor = g_tweakGuiColors->GetPowerBombDigitDelpetedFont();
outlineColor = g_tweakGuiColors->GetPowerBombDigitDelpetedOutline();
} else {
fontColor = zeus::CColor::skClear;
outlineColor = zeus::CColor::skClear;
fontColor = zeus::skClear;
outlineColor = zeus::skClear;
}
x10_textpane_bombdigits->TextSupport().SetFontColor(fontColor);
x10_textpane_bombdigits->TextSupport().SetOutlineColor(outlineColor);
@ -56,7 +56,7 @@ void CHudBallInterface::UpdatePowerBombReadoutColors() {
else if (x44_pbCapacity > 0)
iconColor = g_tweakGuiColors->GetPowerBombIconDepletedColor();
else
iconColor = zeus::CColor::skClear;
iconColor = zeus::skClear;
xc_model_bombicon->SetColor(iconColor);
}

View File

@ -27,7 +27,7 @@ void CHudBossEnergyInterface::Update(float dt) {
x4_fader = std::max(0.f, x4_fader - dt);
if (x4_fader > 0.f) {
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = x0_alpha * x4_fader;
x14_basewidget_bossenergystuff->SetColor(color);
x14_basewidget_bossenergystuff->SetVisibility(true, ETraversalMode::Children);

View File

@ -60,7 +60,7 @@ void CHudDecoInterfaceCombat::SetDamageTransform(const zeus::CMatrix3f& rotation
}
void CHudDecoInterfaceCombat::SetFrameColorValue(float v) {
zeus::CColor color = v > 0.f ? zeus::CColor::skWhite : g_tweakGuiColors->GetHudFrameColor();
zeus::CColor color = v > 0.f ? zeus::skWhite : g_tweakGuiColors->GetHudFrameColor();
x7c_basewidget_frame->SetColor(color);
}
@ -76,7 +76,7 @@ void CHudDecoInterfaceCombat::UpdateCameraDebugSettings(float fov, float y, floa
}
void CHudDecoInterfaceCombat::UpdateHudAlpha() {
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = g_GameState->GameOptions().GetHUDAlpha() / 255.f;
x70_basewidget_pivot->SetColor(color);
}
@ -180,8 +180,8 @@ void CHudDecoInterfaceScan::InitializeFlatFrame() {
x25c_flat_energybart01_scanbar->SetCoordFunc(CAuiEnergyBarT01::DownloadBarCoordFunc);
x25c_flat_energybart01_scanbar->ResetMaxEnergy();
x25c_flat_energybart01_scanbar->SetFilledColor(zeus::CColor(0.4f, 0.68f, 0.88f, 1.f));
x25c_flat_energybart01_scanbar->SetShadowColor(zeus::CColor::skClear);
x25c_flat_energybart01_scanbar->SetEmptyColor(zeus::CColor::skClear);
x25c_flat_energybart01_scanbar->SetShadowColor(zeus::skClear);
x25c_flat_energybart01_scanbar->SetEmptyColor(zeus::skClear);
x25c_flat_energybart01_scanbar->SetFilledDrainSpeed(999.f);
x25c_flat_energybart01_scanbar->SetShadowDrainSpeed(999.f);
x25c_flat_energybart01_scanbar->SetShadowDrainDelay(0.f);
@ -262,7 +262,7 @@ void CHudDecoInterfaceScan::UpdateScanDisplay(const CStateManager& stateMgr, flo
x238_scanningTextAlpha = std::max(0.f, x238_scanningTextAlpha - dt);
if (x238_scanningTextAlpha > 0.f) {
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = std::min(x238_scanningTextAlpha, 1.f);
x254_flat_textpane_scanning->SetColor(color);
x254_flat_textpane_scanning->SetIsVisible(true);
@ -276,7 +276,7 @@ void CHudDecoInterfaceScan::UpdateScanDisplay(const CStateManager& stateMgr, flo
x23c_scanBarAlpha = std::max(0.f, x23c_scanBarAlpha - 2.f * dt);
if (x23c_scanBarAlpha > 0.f) {
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = std::min(x23c_scanBarAlpha, 1.f);
x258_flat_basewidget_scanguage->SetColor(color);
x258_flat_basewidget_scanguage->SetVisibility(true, ETraversalMode::Children);
@ -337,7 +337,7 @@ void CHudDecoInterfaceScan::UpdateCameraDebugSettings(float fov, float y, float
}
void CHudDecoInterfaceScan::UpdateHudAlpha() {
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = g_GameState->GameOptions().GetHUDAlpha() / 255.f;
x248_basewidget_pivot->SetColor(color);
}
@ -429,7 +429,7 @@ void CHudDecoInterfaceXRay::UpdateCameraDebugSettings(float fov, float y, float
}
void CHudDecoInterfaceXRay::UpdateHudAlpha() {
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = g_GameState->GameOptions().GetHUDAlpha() / 255.f;
xa4_basewidget_pivot->SetColor(color);
}
@ -520,7 +520,7 @@ void CHudDecoInterfaceThermal::Update(float dt, const CStateManager& stateMgr) {
if (x6c_retflashTimer > 1.f)
x6c_retflashTimer -= 2.f;
zeus::CColor flashColor = zeus::CColor::skWhite;
zeus::CColor flashColor = zeus::skWhite;
flashColor.a() = std::fabs(x6c_retflashTimer) * 0.5f + 0.5f;
x80_model_retflash->SetColor(flashColor);
@ -537,7 +537,7 @@ void CHudDecoInterfaceThermal::UpdateCameraDebugSettings(float fov, float y, flo
}
void CHudDecoInterfaceThermal::UpdateHudAlpha() {
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = g_GameState->GameOptions().GetHUDAlpha() / 255.f;
x78_basewidget_pivot->SetColor(color);
}

View File

@ -74,12 +74,12 @@ void CHudEnergyInterface::Update(float dt, float energyLowPulse) {
if (x28_textpane_energywarning) {
if (x1c_27_energyLow) {
x4_energyLowFader = std::min(x4_energyLowFader + 2.f * dt, 1.f);
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = x4_energyLowFader * energyLowPulse;
x28_textpane_energywarning->SetColor(color);
} else {
x4_energyLowFader = std::max(0.f, x4_energyLowFader - 2.f * dt);
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = x4_energyLowFader * energyLowPulse;
x28_textpane_energywarning->SetColor(color);
}

View File

@ -72,7 +72,7 @@ void CHudFreeLookInterface::SetFreeLookState(bool inFreeLook, bool lookControlHe
x88_model_freelookright->SetLocalTransform(x38_freeLookRightXf *
zeus::CTransform::Translate(0.f, 0.f, vertLookAngle));
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
float totalInterp = x68_freeLookInterp * (1.f - x6c_lockOnInterp);
color.a() = totalInterp;
x74_basewidget_freelookleft->SetColor(color);
@ -141,7 +141,7 @@ void CHudFreeLookInterfaceXRay::SetFreeLookState(bool inFreeLook, bool lookContr
x30_model_freelookright->SetLocalTransform(
zeus::CTransform(zeus::CMatrix3f::RotateY(-vertLookAngle), x10_freeLookRightPos));
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = x1c_freeLookInterp;
x24_basewidget_freelook->SetColor(color);

View File

@ -52,7 +52,7 @@ void CHudHelmetInterface::UpdateCameraDebugSettings(float fov, float y, float z)
}
void CHudHelmetInterface::UpdateHelmetAlpha() {
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = g_GameState->GameOptions().GetHelmetAlpha() / 255.f;
x44_BaseWidget_Pivot->SetColor(color);
}

View File

@ -184,7 +184,7 @@ void CHudMissileInterface::Update(float dt, const CStateManager& mgr) {
else
tmp = (0.5f - tmp) / 0.25f;
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = x40_missileWarningAlpha * tmp * warnPulse;
x68_textpane_missilewarning->SetColor(color);
if (x68_textpane_missilewarning->GetGeometryColor().a())

View File

@ -53,6 +53,7 @@ void CHudRadarInterface::DrawRadarPaint(const zeus::CVector3f& enemyPos, float r
zeus::CVector2f scopeScaled = playerToEnemy * parms.x70_scopeScalar;
zeus::CColor color = g_tweakGuiColors->GetRadarEnemyPaintColor();
color.a() *= alpha;
color.a() *= parms.x74_alpha;
DoDrawRadarPaint(parms.xc_preTranslate * zeus::CVector3f(scopeScaled.x(), 0.f, scopeScaled.y()), radius, color);
}
}
@ -113,7 +114,7 @@ void CHudRadarInterface::Draw(const CStateManager& mgr, float alpha) const {
zeus::CColor playerColor = g_tweakGuiColors->GetRadarPlayerPaintColor();
playerColor.a() *= alpha;
DoDrawRadarPaint(zeus::CVector3f::skZero, g_tweakGui->GetRadarPlayerPaintRadius(), playerColor);
DoDrawRadarPaint(zeus::skZero3f, g_tweakGui->GetRadarPlayerPaintRadius(), playerColor);
zeus::CAABox radarBounds(
player.GetTranslation().x() - drawParms.x78_xyRadius, player.GetTranslation().y() - drawParms.x78_xyRadius,
@ -127,6 +128,7 @@ void CHudRadarInterface::Draw(const CStateManager& mgr, float alpha) const {
CMaterialFilter::EFilterType::IncludeExclude),
nullptr);
drawParms.x0_playerPos = mgr.GetPlayer().GetTranslation();
drawParms.x74_alpha = alpha;
for (TUniqueId id : nearList) {
if (TCastToConstPtr<CActor> act = mgr.GetObjectById(id)) {

View File

@ -180,12 +180,12 @@ void CHudThreatInterface::Update(float dt) {
if (x68_textpane_threatwarning) {
if (x4c_threatStatus != EThreatStatus::Normal) {
x48_warningLerpAlpha = std::min(x48_warningLerpAlpha + 2.f * dt, 1.f);
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = x48_warningLerpAlpha * xc_damagePulse;
x68_textpane_threatwarning->SetColor(color);
} else {
x48_warningLerpAlpha = std::max(0.f, x48_warningLerpAlpha - 2.f * dt);
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = x48_warningLerpAlpha * xc_damagePulse;
x68_textpane_threatwarning->SetColor(color);
}

View File

@ -65,7 +65,7 @@ CHudVisorBeamMenu::CHudVisorBeamMenu(CGuiFrame& baseHud, EHudVisorBeamMenu type,
x20_textpane_menu->TextSupport().SetOutlineColor(g_tweakGuiColors->GetBeamMenuTextOutline());
}
zeus::CColor titleColor = zeus::CColor::skWhite;
zeus::CColor titleColor = zeus::skWhite;
titleColor.a() = 0.f;
x1c_basewidget_menutitle->SetColor(titleColor);
@ -150,7 +150,7 @@ void CHudVisorBeamMenu::Update(float dt, bool init) {
SMenuItem& item = x28_menuItems[i];
if (item.xc_opacity > 0.f)
item.xc_opacity = std::min(item.xc_opacity + dt, 1.f);
tmpColors[i] = zeus::CColor::lerp(activeColor, zeus::CColor::skClear, item.xc_opacity);
tmpColors[i] = zeus::CColor::lerp(activeColor, zeus::skClear, item.xc_opacity);
}
switch (x6c_animPhase) {
@ -159,7 +159,7 @@ void CHudVisorBeamMenu::Update(float dt, bool init) {
SMenuItem& item = x28_menuItems[i];
zeus::CColor& color0 = (x8_selectedItem == i) ? activeColor : inactiveColor;
zeus::CColor& color1 = (x8_selectedItem == i) ? lozColor : inactiveColor;
zeus::CColor iconColor = (item.xc_opacity == 0.f) ? zeus::CColor::skClear : color0 + tmpColors[i];
zeus::CColor iconColor = (item.xc_opacity == 0.f) ? zeus::skClear : color0 + tmpColors[i];
zeus::CColor lColor = (item.xc_opacity == 0.f) ? lozColor : color1 + tmpColors[i];
item.x4_model_icon->SetColor(iconColor);
item.x0_model_loz->SetColor(lColor);
@ -168,7 +168,7 @@ void CHudVisorBeamMenu::Update(float dt, bool init) {
x24_model_ghost->SetColor(activeColor);
break;
case EAnimPhase::SelectFlash: {
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = 0.f;
x1c_basewidget_menutitle->SetColor(color);
@ -193,7 +193,7 @@ void CHudVisorBeamMenu::Update(float dt, bool init) {
for (int i = 0; i < 4; ++i) {
SMenuItem& item = x28_menuItems[i];
zeus::CColor& color0 = (x8_selectedItem == i) ? activeColor : inactiveColor;
zeus::CColor iconColor = (item.xc_opacity == 0.f) ? zeus::CColor::skClear : color0 + tmpColors[i];
zeus::CColor iconColor = (item.xc_opacity == 0.f) ? zeus::skClear : color0 + tmpColors[i];
item.x4_model_icon->SetColor(iconColor);
item.x0_model_loz->SetColor((item.xc_opacity == 0.f || x8_selectedItem == i) ? lozColor : inactiveColor);
item.x8_positioner = (x8_selectedItem == i) ? 1.f - x10_interp : 1.f;
@ -207,7 +207,7 @@ void CHudVisorBeamMenu::Update(float dt, bool init) {
if (x78_textFader > 0.f) {
x78_textFader = std::max(0.f, x78_textFader - dt);
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = x78_textFader / x7c_animDur;
x1c_basewidget_menutitle->SetColor(color);
}
@ -234,7 +234,7 @@ void CHudVisorBeamMenu::Update(float dt, bool init) {
}
void CHudVisorBeamMenu::UpdateHudAlpha(float alpha) {
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = g_GameState->GameOptions().GetHUDAlpha() / 255.f * alpha;
x18_basewidget_menu->SetColor(color);
}

View File

@ -32,7 +32,7 @@ protected:
public:
CSaveableState() {
x54_colors.resize(3, zeus::CColor::skBlack);
x54_colors.resize(3, zeus::skBlack);
x64_colorOverrides.resize(16);
}

View File

@ -182,7 +182,7 @@ void CScanDisplay::StartScan(TUniqueId id, const CScannableObjectInfo& scanInfo,
color.a() = 0.f;
pane->SetColor(color);
pane->SetTextureID0(-1, g_SimplePool);
pane->SetAnimationParms(zeus::CVector2f::skZero, 0.f, 0.f);
pane->SetAnimationParms(zeus::skZero2f, 0.f, 0.f);
int pos = -1;
for (int j = 0; j < 4; ++j) {
if (x14_scannableInfo->GetBucket(j).x8_imagePos == i) {
@ -226,7 +226,7 @@ void CScanDisplay::StartScan(TUniqueId id, const CScannableObjectInfo& scanInfo,
} else {
dot.SetDesiredAlpha(1.f);
dot.SetDotState(CDataDot::EDotState::Seek);
dot.StartTransitionTo(zeus::CVector2f::skZero, FLT_EPSILON);
dot.StartTransitionTo(zeus::skZero2f, FLT_EPSILON);
dot.Update(FLT_EPSILON);
}
} else {
@ -328,7 +328,7 @@ void CScanDisplay::Update(float dt, float scanningTime) {
case CDataDot::EDotState::Seek:
case CDataDot::EDotState::Hold:
dot.SetDotState(CDataDot::EDotState::RevealPane);
dot.StartTransitionTo(zeus::CVector2f::skZero, g_tweakGui->GetScanAppearanceDuration());
dot.StartTransitionTo(zeus::skZero2f, g_tweakGui->GetScanAppearanceDuration());
break;
case CDataDot::EDotState::RevealPane: {
float tmp = dot.GetTransitionFactor();

View File

@ -18,7 +18,7 @@ void CTargetingManager::Update(float dt, const CStateManager& stateMgr) {
}
void CTargetingManager::Draw(const CStateManager& mgr, bool hideLockon) const {
CGraphics::SetAmbientColor(zeus::CColor::skWhite);
CGraphics::SetAmbientColor(zeus::skWhite);
CGraphics::DisableAllLights();
x21c_orbitPointMarker.Draw(mgr);
const CGameCamera* curCam = mgr.GetCameraManager()->GetCurrentCamera(mgr);

View File

@ -189,7 +189,7 @@ void CTextRenderBuffer::AddCharacter(const zeus::CVector2i& offset, char16_t ch,
inst.SetMetrics(*glyph, offset);
inst.m_fontColor = m_main * color;
inst.m_outlineColor = m_outline * color;
inst.m_mulColor = zeus::CColor::skWhite;
inst.m_mulColor = zeus::skWhite;
}
}

Some files were not shown because too many files have changed in this diff Show More