Updated the ENTIRE CODEBASE TO MATCH
This commit is contained in:
@@ -28,7 +28,7 @@ public:
|
||||
virtual bool OnCommand(const Events::InputCommand& e) override;
|
||||
virtual void Reset();
|
||||
|
||||
void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityID playerID);
|
||||
void AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, Field<double> assaultDashCoolDownTimer, EntityID playerID);
|
||||
virtual bool AssaultDashDoubleTapped() const { return m_AssaultDashDoubleTapped; }
|
||||
virtual bool PlayerIsDashing() const { return m_PlayerIsDashing; }
|
||||
bool SpecialAbilityKeyDown() const { return m_SpecialAbilityKeyDown; }
|
||||
@@ -286,7 +286,7 @@ bool FirstPersonInputController<EventContext>::OnLockMouse(const Events::LockMou
|
||||
}
|
||||
|
||||
template <typename EventContext>
|
||||
void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, double& assaultDashCoolDownTimer, EntityID playerID) {
|
||||
void FirstPersonInputController<EventContext>::AssaultDashCheck(double dt, bool isJumping, double assaultDashCoolDownMaxTimer, Field<double> assaultDashCoolDownTimer, EntityID playerID) {
|
||||
m_AssaultDashDoubleTapDeltaTime += dt;
|
||||
m_DashEffectResetTimer += dt;
|
||||
assaultDashCoolDownTimer -= dt;
|
||||
|
||||
@@ -18,15 +18,15 @@ struct ExplosionEffectJob : ModelJob
|
||||
ExplosionEffectJob(ComponentWrapper explosionEffectComponent, ::Model* model, Camera* camera, glm::mat4 matrix, ::RawModel::MaterialProperties matGroup, ComponentWrapper modelComponent, ::World* world, glm::vec4 fillColor, float fillPercentage, bool isShielded)
|
||||
: ModelJob(model, camera, matrix, matGroup, modelComponent, world, fillColor, fillPercentage, isShielded)
|
||||
{
|
||||
ExplosionOrigin = (glm::vec3)explosionEffectComponent["ExplosionOrigin"];
|
||||
TimeSinceDeath = (double)explosionEffectComponent["TimeSinceDeath"];
|
||||
ExplosionDuration = (double)explosionEffectComponent["ExplosionDuration"];
|
||||
EndColor = (glm::vec4)explosionEffectComponent["EndColor"];
|
||||
Randomness = (bool)explosionEffectComponent["Randomness"];
|
||||
RandomnessScalar = (double)explosionEffectComponent["RandomnessScalar"];
|
||||
Velocity = (glm::vec2)explosionEffectComponent["Velocity"];
|
||||
ColorByDistance = (bool)explosionEffectComponent["ColorByDistance"];
|
||||
ExponentialAccelaration = (bool)explosionEffectComponent["ExponentialAccelaration"];
|
||||
ExplosionOrigin = (Field<glm::vec3>)explosionEffectComponent["ExplosionOrigin"];
|
||||
TimeSinceDeath = (Field<double>)explosionEffectComponent["TimeSinceDeath"];
|
||||
ExplosionDuration = (Field<double>)explosionEffectComponent["ExplosionDuration"];
|
||||
EndColor = (Field<glm::vec4>)explosionEffectComponent["EndColor"];
|
||||
Randomness = (Field<bool>)explosionEffectComponent["Randomness"];
|
||||
RandomnessScalar = (Field<double>)explosionEffectComponent["RandomnessScalar"];
|
||||
Velocity = (Field<glm::vec2>)explosionEffectComponent["Velocity"];
|
||||
ColorByDistance = (Field<bool>)explosionEffectComponent["ColorByDistance"];
|
||||
ExponentialAccelaration = (Field<bool>)explosionEffectComponent["ExponentialAccelaration"];
|
||||
};
|
||||
|
||||
glm::vec3 ExplosionOrigin;
|
||||
|
||||
@@ -17,8 +17,8 @@ struct TextJob : RenderJob
|
||||
: RenderJob()
|
||||
{
|
||||
Matrix = matrix;
|
||||
Color = (glm::vec4)textComponent["Color"];
|
||||
Content = (std::string)textComponent["Content"];
|
||||
Color = (const glm::vec4&)textComponent["Color"];
|
||||
Content = (const std::string&)textComponent["Content"];
|
||||
Resource = font;
|
||||
|
||||
if ((int)textComponent["Alignment"] == textComponent["Alignment"].Enum("Left")) {
|
||||
|
||||
@@ -12,8 +12,8 @@ public:
|
||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override
|
||||
{
|
||||
ComponentWrapper& transform = m_World->GetComponent(component.EntityID, "Transform");
|
||||
(double&)component["Time"] += dt;
|
||||
(glm::vec3&)transform["Position"] = (float)(double)component["Amplitude"] * glm::sin((glm::two_pi<float>() / (float)(double)component["Period"]) * (float)(double)component["Time"]) * (glm::vec3)component["Axis"];
|
||||
(Field<double>)component["Time"] += dt;
|
||||
(Field<glm::vec3>)transform["Position"] = (float)(double)component["Amplitude"] * glm::sin((glm::two_pi<float>() / (float)(double)component["Period"]) * (float)(double)component["Time"]) * (glm::vec3)component["Axis"];
|
||||
|
||||
}
|
||||
};
|
||||
@@ -1,6 +1,25 @@
|
||||
#include "Common.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
|
||||
|
||||
//struct FSubscriptProxy
|
||||
// {
|
||||
// friend struct ComponentWrapper;
|
||||
// FSubscriptProxy(ComponentWrapper* component, std::string fieldName)
|
||||
// : m_Component(component)
|
||||
// , m_FieldName(fieldName)
|
||||
// { }
|
||||
|
||||
// ComponentWrapper* m_Component;
|
||||
// std::string m_FieldName;
|
||||
|
||||
// public:
|
||||
// template <typename T>
|
||||
// operator Field<T>() { return Field<T>(m_Component->Field<T>(m_FieldName)); }
|
||||
|
||||
// };
|
||||
|
||||
class RaptorCopterSystem : public PureSystem
|
||||
{
|
||||
public:
|
||||
@@ -9,9 +28,11 @@ public:
|
||||
, PureSystem("RaptorCopter")
|
||||
{ }
|
||||
|
||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) override
|
||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& cRaptorCopter, double dt) override
|
||||
{
|
||||
ComponentWrapper& transform = m_World->GetComponent(component.EntityID, "Transform");
|
||||
(glm::vec3&)transform["Orientation"] += (float)(double)component["Speed"] * (float)dt * (glm::vec3)component["Axis"];
|
||||
ComponentWrapper& cTransform = entity["Transform"];
|
||||
//FSubscriptProxy subOri(&cTransform, "Orientation");
|
||||
//Field<glm::vec3> orientation = subOri;
|
||||
(Field<glm::vec3>)cTransform["Orientation"] += (float)(const double&)cRaptorCopter["Speed"] * (float)dt * (glm::vec3)cRaptorCopter["Axis"];
|
||||
}
|
||||
};
|
||||
@@ -269,7 +269,8 @@ private:
|
||||
EntityWrapper thirdPersonAttachment;
|
||||
for (auto& attachment : weaponAttachments) {
|
||||
ComponentWrapper cWeaponAttachment = attachment["WeaponAttachment"];
|
||||
if ((std::string&)cWeaponAttachment["Weapon"] == m_ComponentType) {
|
||||
Field<std::string> weaponType = cWeaponAttachment["Weapon"];
|
||||
if (*weaponType == m_ComponentType) {
|
||||
ComponentWrapper::SubscriptProxy person = cWeaponAttachment["Person"];
|
||||
if ((ComponentInfo::EnumType)person == person.Enum("FirstPerson")) {
|
||||
firstPersonAttachment = attachment;
|
||||
|
||||
Reference in New Issue
Block a user