This commit is contained in:
Phillip Stephens 2016-04-22 13:23:18 -07:00
commit dbab69bf97
3 changed files with 35 additions and 2 deletions

View File

@ -58,8 +58,7 @@ RigInverter<CINFType>::Bone::Bone(const CINFType& cinf, const typename CINFType:
m_tail /= float(actualChildren); m_tail /= float(actualChildren);
if ((m_tail - boneOrigin).magSquared() < 0.001f) if ((m_tail - boneOrigin).magSquared() < 0.001f)
m_tail = naturalTail; m_tail = naturalTail;
else if (isLCTR)
if (isLCTR)
m_tail = boneOrigin + zeus::CVector3f{0.f, 1.0f, 0.f} * (m_tail - boneOrigin).magnitude(); m_tail = boneOrigin + zeus::CVector3f{0.f, 1.0f, 0.f} * (m_tail - boneOrigin).magnitude();
} }
else if (parentIdx != -1) else if (parentIdx != -1)

View File

@ -41,6 +41,12 @@ class CCameraManager
public: public:
CCameraManager(TUniqueId curCameraId); CCameraManager(TUniqueId curCameraId);
static float DefaultAspect() {return 1.42f;}
static float DefaultFarPlane() {return 750.0f;}
static float DefaultNearPlane() {return 0.2f;}
static float DefaultFirstPersonFOV() {return 55.0f;}
static float DefaultThirdPersonFOV() {return 60.0f;}
void SetSpecialCameras(CFirstPersonCamera& fp, CBallCamera& ball) void SetSpecialCameras(CFirstPersonCamera& fp, CBallCamera& ball)
{ {
x7c_fpCamera = &fp; x7c_fpCamera = &fp;

View File

@ -25,6 +25,7 @@
#include "CScriptSound.hpp" #include "CScriptSound.hpp"
#include "CScriptGenerator.hpp" #include "CScriptGenerator.hpp"
#include "CScriptGrapplePoint.hpp" #include "CScriptGrapplePoint.hpp"
#include "Camera/CCinematicCamera.hpp"
#include "CSimplePool.hpp" #include "CSimplePool.hpp"
#include "Collision/CCollidableOBBTreeGroup.hpp" #include "Collision/CCollidableOBBTreeGroup.hpp"
#include "Editor/ProjectResourceFactoryMP1.hpp" #include "Editor/ProjectResourceFactoryMP1.hpp"
@ -730,6 +731,33 @@ CEntity* ScriptLoader::LoadDock(CStateManager& mgr, CInputStream& in,
CEntity* ScriptLoader::LoadCamera(CStateManager& mgr, CInputStream& in, CEntity* ScriptLoader::LoadCamera(CStateManager& mgr, CInputStream& in,
int propCount, const CEntityInfo& info) int propCount, const CEntityInfo& info)
{ {
if (!EnsurePropertyCount(propCount, 14, "Camera"))
return nullptr;
SActorHead head = LoadActorHead(in, mgr);
bool b1 = in.readBool();
float f1 = in.readFloatBig();
bool b2 = in.readBool();
bool b3 = in.readBool();
bool b4 = in.readBool();
bool b5 = in.readBool();
bool b6 = in.readBool();
bool b7 = in.readBool();
bool b8 = in.readBool();
float f2 = in.readFloatBig();
bool b9 = in.readBool();
bool b10 = false;
if (propCount > 14)
b10 = in.readBool();
u32 flags = b2 | b3 << 1 | b4 << 2 | b5 << 3 | b6 << 4 | b7 << 5 | b8 << 6 | b9 << 8;
return new CCinematicCamera(mgr.AllocateUniqueId(), head.x0_name, info,
head.x10_transform, b1, f1, f2 / CCameraManager::DefaultAspect(),
CCameraManager::DefaultNearPlane(), CCameraManager::DefaultFarPlane(),
CCameraManager::DefaultAspect(), flags);
} }
CEntity* ScriptLoader::LoadCameraWaypoint(CStateManager& mgr, CInputStream& in, CEntity* ScriptLoader::LoadCameraWaypoint(CStateManager& mgr, CInputStream& in,