1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 03:42:48 +01:00

Stop using default initialization onglm datatypes.

It results in undefined behaviour with glm 0.9.9
This commit is contained in:
Lucas Eriksson 2018-02-06 20:47:31 +01:00 committed by Daniel Evans
parent 5bf92e5a0b
commit 3e96ad9c92
54 changed files with 172 additions and 167 deletions

View File

@ -14,7 +14,7 @@ struct AIGraphNode {
}; };
NodeType type; NodeType type;
glm::vec3 position; glm::vec3 position{};
float size; float size;
int other_thing; int other_thing;
int other_thing2; int other_thing2;

View File

@ -4,7 +4,7 @@
#include <ai/CharacterController.hpp> #include <ai/CharacterController.hpp>
class DefaultAIController : public CharacterController { class DefaultAIController : public CharacterController {
glm::vec3 gotoPos; glm::vec3 gotoPos{};
public: public:
DefaultAIController() DefaultAIController()

View File

@ -6,9 +6,9 @@
#include <ai/CharacterController.hpp> #include <ai/CharacterController.hpp>
class PlayerController : public CharacterController { class PlayerController : public CharacterController {
glm::quat cameraRotation; glm::quat cameraRotation{1.0f,0.0f,0.0f,0.0f};
glm::vec3 direction; glm::vec3 direction{};
glm::quat lastRotation; glm::quat lastRotation;

View File

@ -31,7 +31,7 @@ bool ChaseKeyframe::load(const std::string &filePath,
uint8_t driving; uint8_t driving;
uint8_t braking; uint8_t braking;
uint8_t handbrake; uint8_t handbrake;
glm::vec3 position; glm::vec3 position{};
}; };
static_assert(sizeof(ChaseEntryRecord) == 28, static_assert(sizeof(ChaseEntryRecord) == 28,

View File

@ -19,14 +19,14 @@ struct CollisionModel {
/// @todo give shapes surface data /// @todo give shapes surface data
struct Sphere { struct Sphere {
glm::vec3 center; glm::vec3 center{};
float radius; float radius;
Surface surface; Surface surface;
}; };
struct Box { struct Box {
glm::vec3 min; glm::vec3 min{};
glm::vec3 max; glm::vec3 max{};
Surface surface; Surface surface;
}; };

View File

@ -21,7 +21,7 @@ struct CutsceneMetadata {
std::string name; std::string name;
/// The origin for coordinates in the cutscene /// The origin for coordinates in the cutscene
glm::vec3 sceneOffset; glm::vec3 sceneOffset{};
std::vector<ModelEntry> models; std::vector<ModelEntry> models;
std::map<float, TextEntry> texts; std::map<float, TextEntry> texts;

View File

@ -14,7 +14,7 @@ struct PathNode {
NodeType type; NodeType type;
int32_t next; int32_t next;
glm::vec3 position; glm::vec3 position{};
float size; float size;
int other_thing; int other_thing;
int other_thing2; int other_thing2;

View File

@ -18,7 +18,7 @@ struct WeaponData {
float meleeRadius; float meleeRadius;
float lifeSpan; float lifeSpan;
float spread; float spread;
glm::vec3 fireOffset; glm::vec3 fireOffset{};
std::string animation1; std::string animation1;
std::string animation2; std::string animation2;
float animLoopStart; float animLoopStart;
@ -51,10 +51,10 @@ struct WeaponScan {
float damage; float damage;
glm::vec3 center; glm::vec3 center{};
float radius; float radius;
glm::vec3 end; glm::vec3 end{};
WeaponData* weapon; WeaponData* weapon;

View File

@ -13,12 +13,12 @@ enum class WeatherCondition { Sunny = 0, Cloudy = 1, Rainy = 2, Foggy = 3 };
class Weather { class Weather {
public: public:
struct Entry { struct Entry {
glm::vec3 ambientColor; glm::vec3 ambientColor{};
glm::vec3 directLightColor; glm::vec3 directLightColor{};
glm::vec3 skyTopColor; glm::vec3 skyTopColor{};
glm::vec3 skyBottomColor; glm::vec3 skyBottomColor{};
glm::vec3 sunCoreColor; glm::vec3 sunCoreColor{};
glm::vec3 sunCoronaColor; glm::vec3 sunCoronaColor{};
float sunCoreSize; float sunCoreSize;
float sunCoronaSize; float sunCoronaSize;
float sunBrightness; float sunBrightness;
@ -28,9 +28,9 @@ public:
float farClipping; float farClipping;
float fogStart; float fogStart;
float amountGroundLight; float amountGroundLight;
glm::vec3 lowCloudColor; glm::vec3 lowCloudColor{};
glm::vec3 topCloudColor; glm::vec3 topCloudColor{};
glm::vec3 bottomCloudColor; glm::vec3 bottomCloudColor{};
uint8_t unknown[4]; uint8_t unknown[4];
}; };

View File

@ -16,24 +16,24 @@ struct ZoneData {
/** /**
* The name of the Zone (see .gxt) * The name of the Zone (see .gxt)
*/ */
std::string name; std::string name{};
int type; int type{};
/** /**
* Bottom left of the Zone * Bottom left of the Zone
*/ */
glm::vec3 min; glm::vec3 min{};
/** /**
* Top Right of the zone * Top Right of the zone
*/ */
glm::vec3 max; glm::vec3 max{};
/** /**
* Island number * Island number
*/ */
int island; int island{};
/** /**
* Text of the zone? * Text of the zone?

View File

@ -19,8 +19,8 @@ void Animator::tick(float dt) {
} }
struct BoneTransform { struct BoneTransform {
glm::vec3 translation; glm::vec3 translation{};
glm::quat rotation; glm::quat rotation{1.0f,0.0f,0.0f,0.0f};
}; };
#if 0 #if 0

View File

@ -99,10 +99,12 @@ GameState::GameState()
, maxWantedLevel(0) , maxWantedLevel(0)
, playerObject(0) , playerObject(0)
, scriptOnMissionFlag(nullptr) , scriptOnMissionFlag(nullptr)
, nextRestartLocation{}
, fadeOut(true) , fadeOut(true)
, fadeStart(0.f) , fadeStart(0.f)
, fadeTime(0.f) , fadeTime(0.f)
, fadeSound(false) , fadeSound(false)
, fadeColour{}
, skipCutscene(false) , skipCutscene(false)
, isIntroPlaying(false) , isIntroPlaying(false)
, currentCutscene(nullptr) , currentCutscene(nullptr)
@ -111,6 +113,8 @@ GameState::GameState()
, hudFlash(HudFlash::Disabled) , hudFlash(HudFlash::Disabled)
, cameraNear(0.1f) , cameraNear(0.1f)
, cameraFixed(false) , cameraFixed(false)
, cameraPosition{}
, cameraRotation{1.0f,0.0f,0.0f,0.0f}
, cameraTarget(0) , cameraTarget(0)
, importExportPortland(0) , importExportPortland(0)
, importExportShoreside(0) , importExportShoreside(0)

View File

@ -159,10 +159,10 @@ struct GameStats {
struct TextDisplayData { struct TextDisplayData {
// This is set by the final display text command. // This is set by the final display text command.
GameString text; GameString text;
glm::vec2 position; glm::vec2 position{};
glm::vec4 colourFG; glm::vec4 colourFG{};
glm::vec4 colourBG; glm::vec4 colourBG{};
}; };
/** /**
@ -181,7 +181,7 @@ struct BlipData {
BlipType type; BlipType type;
GameObjectID target; GameObjectID target;
// If target is null then use coord // If target is null then use coord
glm::vec3 coord; glm::vec3 coord{};
std::string texture; // Texture for use in the radar std::string texture; // Texture for use in the radar
uint32_t colour = 0; // Color value (index or RGBA) uint32_t colour = 0; // Color value (index or RGBA)

View File

@ -59,8 +59,8 @@ struct AreaIndicatorInfo {
enum AreaIndicatorType { Cylinder }; enum AreaIndicatorType { Cylinder };
AreaIndicatorType type; AreaIndicatorType type;
glm::vec3 position; glm::vec3 position{};
glm::vec3 radius; glm::vec3 radius{};
}; };
/** /**
@ -102,34 +102,34 @@ public:
* Creates an instance * Creates an instance
*/ */
InstanceObject* createInstance(const uint16_t id, const glm::vec3& pos, InstanceObject* createInstance(const uint16_t id, const glm::vec3& pos,
const glm::quat& rot = glm::quat()); const glm::quat& rot = glm::quat{1.0f,0.0f,0.0f,0.0f});
/** /**
* @brief Creates an InstanceObject for use in the current Cutscene. * @brief Creates an InstanceObject for use in the current Cutscene.
*/ */
CutsceneObject* createCutsceneObject(const uint16_t id, CutsceneObject* createCutsceneObject(const uint16_t id,
const glm::vec3& pos, const glm::vec3& pos,
const glm::quat& rot = glm::quat()); const glm::quat& rot = glm::quat{1.0f,0.0f,0.0f,0.0f});
/** /**
* Creates a vehicle * Creates a vehicle
*/ */
VehicleObject* createVehicle(const uint16_t id, const glm::vec3& pos, VehicleObject* createVehicle(const uint16_t id, const glm::vec3& pos,
const glm::quat& rot = glm::quat(), const glm::quat& rot = glm::quat{1.0f,0.0f,0.0f,0.0f},
GameObjectID gid = 0); GameObjectID gid = 0);
/** /**
* Creates a pedestrian. * Creates a pedestrian.
*/ */
CharacterObject* createPedestrian(const uint16_t id, const glm::vec3& pos, CharacterObject* createPedestrian(const uint16_t id, const glm::vec3& pos,
const glm::quat& rot = glm::quat(), const glm::quat& rot = glm::quat{1.0f,0.0f,0.0f,0.0f},
GameObjectID gid = 0); GameObjectID gid = 0);
/** /**
* Creates a player * Creates a player
*/ */
CharacterObject* createPlayer(const glm::vec3& pos, CharacterObject* createPlayer(const glm::vec3& pos,
const glm::quat& rot = glm::quat(), const glm::quat& rot = glm::quat{1.0f,0.0f,0.0f,0.0f},
GameObjectID gid = 0); GameObjectID gid = 0);
/** /**

View File

@ -108,7 +108,7 @@ struct StructWeaponSlot {
}; };
struct StructPed { struct StructPed {
uint8_t unknown0_[52]; uint8_t unknown0_[52];
glm::vec3 position; glm::vec3 position{};
uint8_t unknown1[640]; uint8_t unknown1[640];
float health; float health;
float armour; float armour;
@ -130,8 +130,8 @@ struct Block1PlayerPed {
struct StructStoredCar { struct StructStoredCar {
BlockDword modelId; BlockDword modelId;
glm::vec3 position; glm::vec3 position{};
glm::vec3 rotation; glm::vec3 rotation{};
BlockDword immunities; BlockDword immunities;
uint8_t colorFG; uint8_t colorFG;
uint8_t colorBG; uint8_t colorBG;
@ -186,8 +186,8 @@ struct StructGarage {
float z2; float z2;
float doorOpenStart; float doorOpenStart;
float doorOpenAngle; float doorOpenAngle;
glm::vec2 unknownCoord1; glm::vec2 unknownCoord1{};
glm::vec2 unknownCoord2; glm::vec2 unknownCoord2{};
float doorAZ; float doorAZ;
float doorBZ; float doorBZ;
BlockDword unknown15; BlockDword unknown15;
@ -228,7 +228,7 @@ struct Block2GarageData {
struct Block3VehicleState { struct Block3VehicleState {
uint8_t unknown1[52]; uint8_t unknown1[52];
glm::vec3 position; glm::vec3 position{};
uint8_t unknown2[1384]; uint8_t unknown2[1384];
}; };
@ -241,7 +241,7 @@ struct Block3Vehicle {
struct Block3BoatState { struct Block3BoatState {
uint8_t unknown1[52]; uint8_t unknown1[52];
glm::vec3 position; glm::vec3 position{};
uint8_t unknown2[1092]; uint8_t unknown2[1092];
}; };
@ -255,7 +255,7 @@ struct Block3Boat {
struct Block4Object { struct Block4Object {
BlockWord modelId; BlockWord modelId;
BlockDword reference; BlockDword reference;
glm::vec3 position; glm::vec3 position{};
int8_t rotation[9]; /// @todo Confirm that this is: right, forward, down int8_t rotation[9]; /// @todo Confirm that this is: right, forward, down
uint8_t unknown1[3]; uint8_t unknown1[3];
float unknown2; float unknown2;
@ -277,7 +277,7 @@ struct Block6Crane {
float y1Pickup; float y1Pickup;
float x2Pickup; float x2Pickup;
float y2Pickup; float y2Pickup;
glm::vec3 dropoff; glm::vec3 dropoff{};
float dropoffHeadingRads; float dropoffHeadingRads;
float pickupArmRads; float pickupArmRads;
float dropoffArmRads; float dropoffArmRads;
@ -288,8 +288,8 @@ struct Block6Crane {
float armCurrentRads; float armCurrentRads;
float armCurrentDistance; float armCurrentDistance;
float armCurrentHeight; float armCurrentHeight;
glm::vec3 hookInitialPosition; glm::vec3 hookInitialPosition{};
glm::vec3 hookCurrentPosition; glm::vec3 hookCurrentPosition{};
float unknown1[2]; float unknown1[2];
BlockDword vehiclePtr; BlockDword vehiclePtr;
BlockDword gameTime; BlockDword gameTime;
@ -317,7 +317,7 @@ struct Block7Pickup {
BlockDword regenTime; BlockDword regenTime;
BlockWord modelId; BlockWord modelId;
BlockWord flags; BlockWord flags;
glm::vec3 position; glm::vec3 position{};
}; };
struct Block7Data { struct Block7Data {
@ -333,7 +333,7 @@ struct Block8Data {
}; };
struct Block8Phone { struct Block8Phone {
glm::vec3 position; glm::vec3 position{};
BlockDword messagePtr[6]; BlockDword messagePtr[6];
BlockDword messageEndTime; BlockDword messageEndTime;
BlockDword staticIndex; BlockDword staticIndex;
@ -343,7 +343,7 @@ struct Block8Phone {
}; };
struct Block9Restart { struct Block9Restart {
glm::vec3 position; glm::vec3 position{};
float angle; float angle;
}; };
@ -367,7 +367,7 @@ struct Block10Blip {
BlockDword entityHandle; BlockDword entityHandle;
float unknown1; float unknown1;
float unknown2; float unknown2;
glm::vec3 position; glm::vec3 position{};
BlockWord unknown3; BlockWord unknown3;
uint8_t brightness; uint8_t brightness;
uint8_t unknown4; uint8_t unknown4;
@ -384,8 +384,8 @@ struct Block10Data {
struct Block11Zone { struct Block11Zone {
char name[8]; char name[8];
glm::vec3 coordA; glm::vec3 coordA{};
glm::vec3 coordB; glm::vec3 coordB{};
BlockDword type; BlockDword type;
BlockDword level; BlockDword level;
BlockWord dayZoneInfo; BlockWord dayZoneInfo;
@ -435,7 +435,7 @@ struct Block12Data {
struct Block13CarGenerator { struct Block13CarGenerator {
BlockDword modelId; BlockDword modelId;
glm::vec3 position; glm::vec3 position{};
float angle; float angle;
BlockWord colourFG; BlockWord colourFG;
BlockWord colourBG; BlockWord colourBG;
@ -475,7 +475,7 @@ struct Block15AudioObject {
BlockDword index; BlockDword index;
BlockWord soundIndex; BlockWord soundIndex;
uint8_t align[2]; uint8_t align[2];
glm::vec3 position; glm::vec3 position{};
BlockDword unknown1; BlockDword unknown1;
}; };

View File

@ -37,15 +37,15 @@ struct ScreenTextEntry {
/// After processing numbers /// After processing numbers
GameString text; GameString text;
/// in the virtual 640x480 screen space /// in the virtual 640x480 screen space
glm::vec2 position; glm::vec2 position{};
/// Font number /// Font number
int font; int font;
/// Font size /// Font size
int size; int size;
/// Background colour (or, if a == 0, shadow offset) /// Background colour (or, if a == 0, shadow offset)
glm::u8vec4 colourBG; glm::u8vec4 colourBG{};
/// Foreground colour /// Foreground colour
glm::u8vec3 colourFG; glm::u8vec3 colourFG{};
/// Alignment (left = 0, center = 1, right = 2) /// Alignment (left = 0, center = 1, right = 2)
unsigned char alignment; unsigned char alignment;
/// Onscreen duration /// Onscreen duration

View File

@ -13,9 +13,9 @@
#include <rw/forward.hpp> #include <rw/forward.hpp>
struct AnimationKeyframe { struct AnimationKeyframe {
glm::quat rotation; glm::quat rotation{1.0f,0.0f,0.0f,0.0f};
glm::vec3 position; glm::vec3 position{};
glm::vec3 scale; glm::vec3 scale{1.0f};
float starttime = 0.f; float starttime = 0.f;
int id = 0; int id = 0;

View File

@ -120,7 +120,7 @@ void CharacterObject::destroyActor() {
} }
glm::vec3 CharacterObject::updateMovementAnimation(float dt) { glm::vec3 CharacterObject::updateMovementAnimation(float dt) {
glm::vec3 animTranslate; glm::vec3 animTranslate{};
if (motionBlockedByActivity) { if (motionBlockedByActivity) {
// Clear any residual motion animation // Clear any residual motion animation

View File

@ -61,8 +61,8 @@ private:
void createActor(const glm::vec2& size = glm::vec2(0.45f, 1.2f)); void createActor(const glm::vec2& size = glm::vec2(0.45f, 1.2f));
void destroyActor(); void destroyActor();
glm::vec3 movement; glm::vec3 movement{};
glm::vec2 m_look; glm::vec2 m_look{};
bool running; bool running;
bool jumped; bool jumped;
@ -71,7 +71,7 @@ private:
bool motionBlockedByActivity; bool motionBlockedByActivity;
glm::vec3 updateMovementAnimation(float dt); glm::vec3 updateMovementAnimation(float dt);
glm::vec3 currenteMovementStep; glm::vec3 currenteMovementStep{};
AnimCycle cycle_; AnimCycle cycle_;

View File

@ -161,12 +161,12 @@ public:
/** /**
* World position of damage * World position of damage
*/ */
glm::vec3 damageLocation; glm::vec3 damageLocation{};
/** /**
* World position of the source (used for direction) * World position of the source (used for direction)
*/ */
glm::vec3 damageSource; glm::vec3 damageSource{};
/** /**
* Magnitude of destruction * Magnitude of destruction
@ -209,7 +209,7 @@ public:
} }
glm::mat4 getTimeAdjustedTransform(float alpha) const { glm::mat4 getTimeAdjustedTransform(float alpha) const {
glm::mat4 t; glm::mat4 t{1.0f};
t = glm::translate(t, glm::mix(_lastPosition, getPosition(), alpha)); t = glm::translate(t, glm::mix(_lastPosition, getPosition(), alpha));
t = t * glm::mat4_cast(glm::slerp(_lastRotation, getRotation(), alpha)); t = t * glm::mat4_cast(glm::slerp(_lastRotation, getRotation(), alpha));
return t; return t;

View File

@ -84,7 +84,7 @@ uint32_t PickupObject::behaviourFlags(PickupType type) {
PickupObject::PickupObject(GameWorld* world, const glm::vec3& position, PickupObject::PickupObject(GameWorld* world, const glm::vec3& position,
BaseModelInfo* modelinfo, PickupType type) BaseModelInfo* modelinfo, PickupType type)
: GameObject(world, position, glm::quat(), modelinfo) : GameObject(world, position, glm::quat{1.0f,0.0f,0.0f,0.0f}, modelinfo)
, m_ghost(nullptr) , m_ghost(nullptr)
, m_shape(nullptr) , m_shape(nullptr)
, m_enabled(false) , m_enabled(false)

View File

@ -113,7 +113,7 @@ void ProjectileObject::cleanup() {
ProjectileObject::ProjectileObject(GameWorld* world, const glm::vec3& position, ProjectileObject::ProjectileObject(GameWorld* world, const glm::vec3& position,
const ProjectileObject::ProjectileInfo& info) const ProjectileObject::ProjectileInfo& info)
: GameObject(world, position, glm::quat(), nullptr) : GameObject(world, position, glm::quat{1.0f,0.0f,0.0f,0.0f}, nullptr)
, _info(info) , _info(info)
, _body(nullptr) , _body(nullptr)
, _ghostBody(nullptr) , _ghostBody(nullptr)

View File

@ -24,7 +24,7 @@ public:
struct ProjectileInfo { struct ProjectileInfo {
ProjectileType type; ProjectileType type;
glm::vec3 direction; glm::vec3 direction{};
float velocity; float velocity;
/** Time to dentonation or removal */ /** Time to dentonation or removal */

View File

@ -19,8 +19,8 @@ struct VehicleHandlingInfo {
std::string ID; std::string ID;
float mass; float mass;
glm::vec3 dimensions; glm::vec3 dimensions{};
glm::vec3 centerOfMass; glm::vec3 centerOfMass{};
float percentSubmerged; float percentSubmerged;
float tractionMulti; float tractionMulti;
float tractionLoss; float tractionLoss;
@ -65,11 +65,11 @@ struct VehicleHandlingInfo {
}; };
struct WheelInfo { struct WheelInfo {
glm::vec3 position; glm::vec3 position{};
}; };
struct SeatInfo { struct SeatInfo {
glm::vec3 offset; glm::vec3 offset{};
}; };
/** /**

View File

@ -351,7 +351,7 @@ void VehicleObject::tickPhysics(float dt) {
for (auto& seat : seatOccupants) { for (auto& seat : seatOccupants) {
auto character = static_cast<CharacterObject*>(seat.second); auto character = static_cast<CharacterObject*>(seat.second);
glm::vec3 passPosition; glm::vec3 passPosition{};
if (character->isEnteringOrExitingVehicle()) { if (character->isEnteringOrExitingVehicle()) {
passPosition = getSeatEntryPositionWorld(seat.first); passPosition = getSeatEntryPositionWorld(seat.first);
} else { } else {

View File

@ -328,7 +328,7 @@ void GameRenderer::renderWorld(GameWorld* world, const ViewCamera& camera,
continue; continue;
} }
glm::mat4 model; glm::mat4 model{1.0f};
if (blip.second.target > 0) { if (blip.second.target > 0) {
auto object = world->getBlipTarget(blip.second); auto object = world->getBlipTarget(blip.second);
@ -390,7 +390,7 @@ void GameRenderer::renderWorld(GameWorld* world, const ViewCamera& camera,
renderer->setUniform(skyProg.get(), "BottomColor", renderer->setUniform(skyProg.get(), "BottomColor",
glm::vec4{weather.skyBottomColor, 1.f}); glm::vec4{weather.skyBottomColor, 1.f});
renderer->draw(glm::mat4(), &skyDbuff, dp); renderer->draw(glm::mat4(1.0f), &skyDbuff, dp);
profSky = renderer->popDebugGroup(); profSky = renderer->popDebugGroup();
@ -471,7 +471,7 @@ void GameRenderer::renderPostProcess() {
wdp.count = ssRectGeom.getCount(); wdp.count = ssRectGeom.getCount();
wdp.textures = {fbTextures[0]}; wdp.textures = {fbTextures[0]};
renderer->drawArrays(glm::mat4(), &ssRectDraw, wdp); renderer->drawArrays(glm::mat4(1.0f), &ssRectDraw, wdp);
} }
void GameRenderer::renderEffects(GameWorld* world) { void GameRenderer::renderEffects(GameWorld* world) {

View File

@ -88,9 +88,9 @@ void MapRenderer::draw(GameWorld* world, const MapInfo& mi) {
float worldScale = mi.screenSize / mi.worldSize; float worldScale = mi.screenSize / mi.worldSize;
auto proj = renderer->get2DProjection(); auto proj = renderer->get2DProjection();
glm::mat4 view, model; glm::mat4 view{1.0f}, model{1.0f};
renderer->setUniform(rectProg.get(), "proj", proj); renderer->setUniform(rectProg.get(), "proj", proj);
renderer->setUniform(rectProg.get(), "model", glm::mat4()); renderer->setUniform(rectProg.get(), "model", glm::mat4(1.0f));
renderer->setUniform(rectProg.get(), "colour", glm::vec4(0.f, 0.f, 0.f, 1.f)); renderer->setUniform(rectProg.get(), "colour", glm::vec4(0.f, 0.f, 0.f, 1.f));
view = glm::translate(view, glm::vec3(mi.screenPosition, 0.f)); view = glm::translate(view, glm::vec3(mi.screenPosition, 0.f));
@ -104,7 +104,7 @@ void MapRenderer::draw(GameWorld* world, const MapInfo& mi) {
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
glStencilMask(0xFF); glStencilMask(0xFF);
glColorMask(0x00, 0x00, 0x00, 0x00); glColorMask(0x00, 0x00, 0x00, 0x00);
renderer->drawArrays(glm::mat4(), &circle, dp); renderer->drawArrays(glm::mat4(1.0f), &circle, dp);
glColorMask(0xFF, 0xFF, 0xFF, 0xFF); glColorMask(0xFF, 0xFF, 0xFF, 0xFF);
glStencilFunc(GL_EQUAL, 1, 0xFF); glStencilFunc(GL_EQUAL, 1, 0xFF);
} }
@ -140,11 +140,11 @@ void MapRenderer::draw(GameWorld* world, const MapInfo& mi) {
renderer->setUniform(rectProg.get(), "model", tilemodel); renderer->setUniform(rectProg.get(), "model", tilemodel);
renderer->drawArrays(glm::mat4(), &rect, dp); renderer->drawArrays(glm::mat4(1.0f), &rect, dp);
} }
// From here on out we will work in screenspace // From here on out we will work in screenspace
renderer->setUniform(rectProg.get(), "view", glm::mat4()); renderer->setUniform(rectProg.get(), "view", glm::mat4(1.0f));
if (mi.clipToSize) { if (mi.clipToSize) {
glDisable(GL_STENCIL_TEST); glDisable(GL_STENCIL_TEST);
@ -154,11 +154,11 @@ void MapRenderer::draw(GameWorld* world, const MapInfo& mi) {
data->findSlotTexture("hud", "radardisc"); data->findSlotTexture("hud", "radardisc");
dp.textures = {radarDisc->getName()}; dp.textures = {radarDisc->getName()};
glm::mat4 model; glm::mat4 model{1.0f};
model = glm::translate(model, glm::vec3(mi.screenPosition, 0.0f)); model = glm::translate(model, glm::vec3(mi.screenPosition, 0.0f));
model = glm::scale(model, glm::vec3(mi.screenSize * 1.07f)); model = glm::scale(model, glm::vec3(mi.screenSize * 1.07f));
renderer->setUniform(rectProg.get(), "model", model); renderer->setUniform(rectProg.get(), "model", model);
renderer->drawArrays(glm::mat4(), &rect, dp); renderer->drawArrays(glm::mat4(1.0f), &rect, dp);
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE,
GL_ZERO); GL_ZERO);
} }
@ -256,7 +256,7 @@ void MapRenderer::prepareBlip(const glm::vec2& coord, const glm::mat4& view,
glm::vec3 viewPos( glm::vec3 viewPos(
view * glm::vec4(glm::vec2(1.f, -1.f) * adjustedCoord, 0.f, 1.f)); view * glm::vec4(glm::vec2(1.f, -1.f) * adjustedCoord, 0.f, 1.f));
glm::mat4 model; glm::mat4 model{1.0f};
model = glm::translate(model, viewPos); model = glm::translate(model, viewPos);
model = glm::scale(model, glm::vec3(size)); model = glm::scale(model, glm::vec3(size));
model = glm::rotate(model, heading, glm::vec3(0.f, 0.f, 1.f)); model = glm::rotate(model, heading, glm::vec3(0.f, 0.f, 1.f));

View File

@ -23,14 +23,14 @@ class MapRenderer {
public: public:
struct MapInfo { struct MapInfo {
/// World coordinate center /// World coordinate center
glm::vec2 worldCenter; glm::vec2 worldCenter{};
/// World units to fit on the map /// World units to fit on the map
float worldSize; float worldSize;
/// yaw of the map /// yaw of the map
float rotation = 0.f; float rotation = 0.f;
glm::vec2 screenPosition; glm::vec2 screenPosition{};
float screenSize; float screenSize;
/// Make the map circular, or don't. /// Make the map circular, or don't.
bool clipToSize = true; bool clipToSize = true;

View File

@ -204,7 +204,7 @@ void ObjectRenderer::renderInstance(InstanceObject* instance,
} }
// Render the atomic the instance thinks it should be // Render the atomic the instance thinks it should be
renderAtomic(atomic.get(), glm::mat4(), instance, outList); renderAtomic(atomic.get(), glm::mat4(1.0f), instance, outList);
} }
void ObjectRenderer::renderCharacter(CharacterObject* pedestrian, void ObjectRenderer::renderCharacter(CharacterObject* pedestrian,
@ -229,7 +229,7 @@ void ObjectRenderer::renderCharacter(CharacterObject* pedestrian,
} }
} }
renderClump(pedestrian->getClump().get(), glm::mat4(), nullptr, outList); renderClump(pedestrian->getClump().get(), glm::mat4(1.0f), nullptr, outList);
auto item = pedestrian->getActiveItem(); auto item = pedestrian->getActiveItem();
const auto& weapon = pedestrian->engine->data->weaponData[item]; const auto& weapon = pedestrian->engine->data->weaponData[item];
@ -268,7 +268,7 @@ void ObjectRenderer::renderVehicle(VehicleObject* vehicle,
vehicle->getLowLOD()->setFlag(Atomic::ATOMIC_RENDER, !highLOD); vehicle->getLowLOD()->setFlag(Atomic::ATOMIC_RENDER, !highLOD);
} }
renderClump(clump.get(), glm::mat4(), vehicle, outList); renderClump(clump.get(), glm::mat4(1.0f), vehicle, outList);
auto modelinfo = vehicle->getVehicle(); auto modelinfo = vehicle->getVehicle();
auto woi = auto woi =
@ -295,7 +295,7 @@ void ObjectRenderer::renderVehicle(VehicleObject* vehicle,
btMatrix3x3(steerQ) * btMatrix3x3(rollQ) * basis, btMatrix3x3(steerQ) * btMatrix3x3(rollQ) * basis,
wi.m_chassisConnectionPointCS + wi.m_chassisConnectionPointCS +
wi.m_wheelDirectionCS * wi.m_raycastInfo.m_suspensionLength); wi.m_wheelDirectionCS * wi.m_raycastInfo.m_suspensionLength);
glm::mat4 wheelM; glm::mat4 wheelM{1.0f};
t.getOpenGLMatrix(glm::value_ptr(wheelM)); t.getOpenGLMatrix(glm::value_ptr(wheelM));
wheelM = clump->getFrame()->getWorldTransform() * wheelM; wheelM = clump->getFrame()->getWorldTransform() * wheelM;
wheelM = glm::scale(wheelM, glm::vec3(modelinfo->wheelscale_)); wheelM = glm::scale(wheelM, glm::vec3(modelinfo->wheelscale_));
@ -310,7 +310,7 @@ void ObjectRenderer::renderVehicle(VehicleObject* vehicle,
void ObjectRenderer::renderPickup(PickupObject* pickup, RenderList& outList) { void ObjectRenderer::renderPickup(PickupObject* pickup, RenderList& outList) {
if (!pickup->isEnabled()) return; if (!pickup->isEnabled()) return;
glm::mat4 modelMatrix = glm::translate(glm::mat4(), pickup->getPosition()); glm::mat4 modelMatrix = glm::translate(glm::mat4(1.0f), pickup->getPosition());
modelMatrix = glm::rotate(modelMatrix, m_world->getGameTime(), modelMatrix = glm::rotate(modelMatrix, m_world->getGameTime(),
glm::vec3(0.f, 0.f, 1.f)); glm::vec3(0.f, 0.f, 1.f));
@ -328,7 +328,7 @@ void ObjectRenderer::renderCutsceneObject(CutsceneObject* cutscene,
auto cutsceneOffset = m_world->state->currentCutscene->meta.sceneOffset + auto cutsceneOffset = m_world->state->currentCutscene->meta.sceneOffset +
glm::vec3(0.f, 0.f, 1.f); glm::vec3(0.f, 0.f, 1.f);
glm::mat4 cutscenespace; glm::mat4 cutscenespace{1.0f};
cutscenespace = glm::translate(cutscenespace, cutsceneOffset); cutscenespace = glm::translate(cutscenespace, cutsceneOffset);
if (cutscene->getParentActor()) { if (cutscene->getParentActor()) {

View File

@ -23,7 +23,7 @@ typedef uint64_t RenderKey;
typedef std::uint32_t RenderIndex; typedef std::uint32_t RenderIndex;
struct VertexP2 { struct VertexP2 {
glm::vec2 position; glm::vec2 position{};
static const AttributeList vertex_attributes() { static const AttributeList vertex_attributes() {
return {{ATRS_Position, 2, sizeof(VertexP2), 0ul}}; return {{ATRS_Position, 2, sizeof(VertexP2), 0ul}};
@ -39,7 +39,7 @@ struct VertexP2 {
struct VertexP3 { struct VertexP3 {
glm::vec3 position; glm::vec3 position{};
static const AttributeList vertex_attributes() { static const AttributeList vertex_attributes() {
return { return {
@ -80,7 +80,7 @@ public:
// Depth writing state // Depth writing state
bool depthWrite; bool depthWrite;
/// Material /// Material
glm::u8vec4 colour; glm::u8vec4 colour{};
/// Material /// Material
float ambient; float ambient;
/// Material /// Material
@ -120,20 +120,20 @@ public:
typedef std::vector<RenderInstruction> RenderList; typedef std::vector<RenderInstruction> RenderList;
struct ObjectUniformData { struct ObjectUniformData {
glm::mat4 model; glm::mat4 model{1.0f};
glm::vec4 colour; glm::vec4 colour{1.0f};
float diffuse; float diffuse;
float ambient; float ambient;
float visibility; float visibility;
}; };
struct SceneUniformData { struct SceneUniformData {
glm::mat4 projection; glm::mat4 projection{1.0f};
glm::mat4 view; glm::mat4 view{1.0f};
glm::vec4 ambient; glm::vec4 ambient{};
glm::vec4 dynamic; glm::vec4 dynamic{};
glm::vec4 fogColour; glm::vec4 fogColour{};
glm::vec4 campos; glm::vec4 campos{};
float fogStart; float fogStart;
float fogEnd; float fogEnd;
}; };
@ -234,8 +234,8 @@ public:
virtual const ProfileInfo& popDebugGroup() = 0; virtual const ProfileInfo& popDebugGroup() = 0;
private: private:
glm::ivec2 viewport; glm::ivec2 viewport{};
glm::mat4 projection2D; glm::mat4 projection2D{1.0f};
protected: protected:
int drawCounter; int drawCounter;

View File

@ -302,7 +302,7 @@ void TextRenderer::renderText(const TextRenderer::TextInfo& ti,
dp.textures = {ftexture->getName()}; dp.textures = {ftexture->getName()};
dp.depthWrite = false; dp.depthWrite = false;
renderer->getRenderer()->drawArrays(glm::mat4(), &db, dp); renderer->getRenderer()->drawArrays(glm::mat4(1.0f), &db, dp);
renderer->getRenderer()->popDebugGroup(); renderer->getRenderer()->popDebugGroup();
} }

View File

@ -35,13 +35,13 @@ public:
/// Message to be displayed (including markup) /// Message to be displayed (including markup)
GameString text; GameString text;
/// On screen position /// On screen position
glm::vec2 screenPosition; glm::vec2 screenPosition{};
/// font size /// font size
float size; float size;
/// Base colour /// Base colour
glm::u8vec3 baseColour; glm::u8vec3 baseColour{};
/// Background colour /// Background colour
glm::u8vec4 backgroundColour; glm::u8vec4 backgroundColour{};
/// Horizontal Alignment /// Horizontal Alignment
TextAlignemnt align; TextAlignemnt align;
/// Wrap width /// Wrap width

View File

@ -11,7 +11,8 @@ public:
glm::vec3 position; glm::vec3 position;
glm::quat rotation; glm::quat rotation;
ViewCamera(const glm::vec3& pos = {}, const glm::quat& rot = {}) ViewCamera(const glm::vec3& pos = {},
const glm::quat& rot = {1.0f,0.0f,0.0f,0.0f})
: frustum({0.1f, 5000.f, glm::radians(45.f), 1.f}) : frustum({0.1f, 5000.f, glm::radians(45.f), 1.f})
, position(pos) , position(pos)
, rotation(rot) { , rotation(rot) {

View File

@ -12,8 +12,8 @@ class ViewFrustum {
public: public:
class ViewPlane { class ViewPlane {
public: public:
glm::vec3 normal; glm::vec3 normal{};
float distance; float distance{};
}; };
float near; float near;

View File

@ -40,7 +40,7 @@ VisualFX::~VisualFX() {
} }
const glm::vec3& VisualFX::getPosition() const { const glm::vec3& VisualFX::getPosition() const {
static glm::vec3 errorRef; static glm::vec3 errorRef{};
switch (type) { switch (type) {
case VisualFX::Particle: case VisualFX::Particle:
return particle.position; return particle.position;

View File

@ -17,10 +17,10 @@ public:
}; };
struct ParticleData { struct ParticleData {
/** Initial world position */ /** Initial world position */
glm::vec3 position; glm::vec3 position{};
/** Direction of particle */ /** Direction of particle */
glm::vec3 direction; glm::vec3 direction{};
/** Particle orientation modes */ /** Particle orientation modes */
enum Orientation { enum Orientation {

View File

@ -99,7 +99,7 @@ public:
*/ */
int activeEntry; int activeEntry;
glm::vec2 offset; glm::vec2 offset{};
void draw(GameRenderer* r) { void draw(GameRenderer* r) {
glm::vec2 basis(offset); glm::vec2 basis(offset);

View File

@ -43,7 +43,7 @@ class RWGame : public GameBase {
}; };
DebugViewMode debugview_ = DebugViewMode::Disabled; DebugViewMode debugview_ = DebugViewMode::Disabled;
int lastDraws; /// Number of draws issued for the last frame. int lastDraws{}; /// Number of draws issued for the last frame.
std::string cheatInputWindow = std::string(32, ' '); std::string cheatInputWindow = std::string(32, ' ');

View File

@ -24,7 +24,7 @@ void BenchmarkState::enter() {
game->getWorld()->state->basic.gameMinute = clockMinute; game->getWorld()->state->basic.gameMinute = clockMinute;
float time = 0.f; float time = 0.f;
glm::vec3 tmpPos; glm::vec3 tmpPos{};
while (benchstream) { while (benchstream) {
TrackPoint point; TrackPoint point;
benchstream >> point.time; benchstream >> point.time;

View File

@ -6,8 +6,8 @@
class BenchmarkState : public State { class BenchmarkState : public State {
struct TrackPoint { struct TrackPoint {
float time; float time;
glm::vec3 position; glm::vec3 position{};
glm::quat angle; glm::quat angle{1.0f,0.0f,0.0f,0.0f};
}; };
std::vector<TrackPoint> track; std::vector<TrackPoint> track;

View File

@ -352,7 +352,7 @@ void DebugState::spawnFollower(unsigned int id) {
glm::vec3 fwd = ch->rotation * glm::vec3(0.f, 1.f, 0.f); glm::vec3 fwd = ch->rotation * glm::vec3(0.f, 1.f, 0.f);
glm::vec3 hit, normal; glm::vec3 hit{}, normal{};
if (game->hitWorldRay(ch->position + (fwd * 10.f), {0.f, 0.f, -2.f}, hit, if (game->hitWorldRay(ch->position + (fwd * 10.f), {0.f, 0.f, -2.f}, hit,
normal)) { normal)) {
auto spawnPos = hit + normal; auto spawnPos = hit + normal;

View File

@ -5,8 +5,8 @@
class DebugState : public State { class DebugState : public State {
ViewCamera _debugCam; ViewCamera _debugCam;
glm::vec3 _movement; glm::vec3 _movement{};
glm::vec2 _debugLook; glm::vec2 _debugLook{};
bool _freeLook = false; bool _freeLook = false;
bool _sonicMode = false; bool _sonicMode = false;
bool _invertedY; bool _invertedY;
@ -19,7 +19,7 @@ class DebugState : public State {
public: public:
DebugState(RWGame* game, const glm::vec3& vp = {}, DebugState(RWGame* game, const glm::vec3& vp = {},
const glm::quat& vd = {}); const glm::quat& vd = {1.0f,0.0f,0.0f,0.0f});
void enter() override; void enter() override;

View File

@ -193,7 +193,7 @@ void IngameState::tick(float dt) {
} }
} }
glm::vec3 movement; glm::vec3 movement{};
movement.x = input(GameInputState::GoForward) - movement.x = input(GameInputState::GoForward) -
input(GameInputState::GoBackwards), input(GameInputState::GoBackwards),
movement.y = movement.y =

View File

@ -20,13 +20,13 @@ class IngameState : public State {
std::string save; std::string save;
bool newgame; bool newgame;
ViewCamera _look; ViewCamera _look;
glm::vec3 cameraPosition; glm::vec3 cameraPosition{};
/** Timer to hold user camera position */ /** Timer to hold user camera position */
float autolookTimer; float autolookTimer;
CameraMode camMode; CameraMode camMode;
/// Player camera input since the last update /// Player camera input since the last update
glm::vec2 cameradelta_; glm::vec2 cameradelta_{};
/// Invert Y axis movement /// Invert Y axis movement
bool m_invertedY; bool m_invertedY;
/// Free look in vehicles. /// Free look in vehicles.

View File

@ -23,7 +23,7 @@ ModelFrame::ModelFrame(unsigned int index, glm::mat3 dR, glm::vec3 dT)
} }
void ModelFrame::reset() { void ModelFrame::reset() {
matrix = glm::translate(glm::mat4(), defaultTranslation) * matrix = glm::translate(glm::mat4(1.0f), defaultTranslation) *
glm::mat4(defaultRotation); glm::mat4(defaultRotation);
updateHierarchyTransform(); updateHierarchyTransform();
} }

View File

@ -22,14 +22,14 @@ class ModelFrame {
unsigned int index; unsigned int index;
glm::mat3 defaultRotation; glm::mat3 defaultRotation;
glm::vec3 defaultTranslation; glm::vec3 defaultTranslation;
glm::mat4 matrix; glm::mat4 matrix{1.0f};
glm::mat4 worldtransform_; glm::mat4 worldtransform_{1.0f};
ModelFrame* parent_; ModelFrame* parent_;
std::string name; std::string name;
std::vector<ModelFramePtr> children_; std::vector<ModelFramePtr> children_;
public: public:
ModelFrame(unsigned int index = 0, glm::mat3 dR = glm::mat3(), ModelFrame(unsigned int index = 0, glm::mat3 dR = glm::mat3{1.0f},
glm::vec3 dT = glm::vec3()); glm::vec3 dT = glm::vec3());
void reset(); void reset();
@ -114,10 +114,10 @@ struct SubGeometry {
}; };
struct GeometryVertex { struct GeometryVertex {
glm::vec3 position; /* 0 */ glm::vec3 position{}; /* 0 */
glm::vec3 normal; /* 24 */ glm::vec3 normal{}; /* 24 */
glm::vec2 texcoord; /* 48 */ glm::vec2 texcoord{}; /* 48 */
glm::u8vec4 colour; /* 64 */ glm::u8vec4 colour{}; /* 64 */
/** @see GeometryBuffer */ /** @see GeometryBuffer */
static const AttributeList vertex_attributes() { static const AttributeList vertex_attributes() {
@ -155,7 +155,7 @@ struct Geometry {
struct Material { struct Material {
std::vector<Texture> textures; std::vector<Texture> textures;
glm::u8vec4 colour; glm::u8vec4 colour{};
uint8_t flags; uint8_t flags;

View File

@ -69,7 +69,7 @@ void ViewerWidget::initGL() {
} }
void ViewerWidget::drawModel(GameRenderer& r, ClumpPtr& model) { void ViewerWidget::drawModel(GameRenderer& r, ClumpPtr& model) {
glm::mat4 view, proj; glm::mat4 view{1.0f}, proj{1.0f};
const auto& vc = OrbitCamera({width(), height()}, const auto& vc = OrbitCamera({width(), height()},
viewAngles, viewAngles,
viewDistance, viewDistance,
@ -83,7 +83,7 @@ void ViewerWidget::drawModel(GameRenderer& r, ClumpPtr& model) {
ObjectRenderer _renderer(world(), vc, 1.f, 0); ObjectRenderer _renderer(world(), vc, 1.f, 0);
RenderList renders; RenderList renders;
_renderer.renderClump(model.get(), glm::mat4(), nullptr, renders); _renderer.renderClump(model.get(), glm::mat4(1.0f), nullptr, renders);
r.getRenderer()->drawBatched(renders); r.getRenderer()->drawBatched(renders);
drawFrameWidget(model->getFrame().get()); drawFrameWidget(model->getFrame().get());
@ -91,7 +91,7 @@ void ViewerWidget::drawModel(GameRenderer& r, ClumpPtr& model) {
} }
void ViewerWidget::drawObject(GameRenderer &r, GameObject *object) { void ViewerWidget::drawObject(GameRenderer &r, GameObject *object) {
glm::mat4 view, proj; glm::mat4 view{1.0f}, proj{1.0f};
const auto& vc = OrbitCamera({width(), height()}, const auto& vc = OrbitCamera({width(), height()},
viewAngles, viewAngles,
viewDistance, viewDistance,
@ -263,7 +263,7 @@ void ViewerWidget::exportModel() {
void ViewerWidget::keyPressEvent(QKeyEvent* e) { void ViewerWidget::keyPressEvent(QKeyEvent* e) {
if (e->key() == Qt::Key_Shift) moveFast = true; if (e->key() == Qt::Key_Shift) moveFast = true;
glm::vec3 movement; glm::vec3 movement{};
if (e->key() == Qt::Key_W) movement.y += moveFast ? 10.f : 1.f; if (e->key() == Qt::Key_W) movement.y += moveFast ? 10.f : 1.f;
if (e->key() == Qt::Key_S) movement.y -= moveFast ? 10.f : 1.f; if (e->key() == Qt::Key_S) movement.y -= moveFast ? 10.f : 1.f;
if (e->key() == Qt::Key_A) movement.x -= moveFast ? 10.f : 1.f; if (e->key() == Qt::Key_A) movement.x -= moveFast ? 10.f : 1.f;

View File

@ -85,12 +85,12 @@ protected:
float viewDistance; float viewDistance;
glm::vec2 viewAngles; glm::vec2 viewAngles{};
glm::vec3 viewPosition; glm::vec3 viewPosition{};
bool dragging; bool dragging;
QPointF dstart; QPointF dstart;
glm::vec2 dastart; glm::vec2 dastart{};
bool moveFast; bool moveFast;
DrawBuffer* _frameWidgetDraw; DrawBuffer* _frameWidgetDraw;

View File

@ -26,8 +26,8 @@ BOOST_AUTO_TEST_CASE(test_matrix) {
1.0f, 1.0f,
AnimationBone::RT0, AnimationBone::RT0,
{ {
{glm::quat(), glm::vec3(0.f, 0.f, 0.f), glm::vec3(), 0.f, 0}, {glm::quat{1.0f,0.0f,0.0f,0.0f}, glm::vec3(0.f, 0.f, 0.f), glm::vec3(), 0.f, 0},
{glm::quat(), glm::vec3(0.f, 1.f, 0.f), glm::vec3(), 1.0f, 1}, {glm::quat{1.0f,0.0f,0.0f,0.0f}, glm::vec3(0.f, 1.f, 0.f), glm::vec3(), 1.0f, 1},
} }
}; };

View File

@ -9,7 +9,7 @@ BOOST_AUTO_TEST_CASE(test_vehicle_buoyancy) {
glm::vec2 tpos(-WATER_WORLD_SIZE / 2.f + 10.f); glm::vec2 tpos(-WATER_WORLD_SIZE / 2.f + 10.f);
{ {
VehicleObject* vehicle = Global::get().e->createVehicle( VehicleObject* vehicle = Global::get().e->createVehicle(
90u, glm::vec3(tpos, 100.f), glm::quat()); 90u, glm::vec3(tpos, 100.f), glm::quat{1.0f,0.0f,0.0f,0.0f});
BOOST_REQUIRE(vehicle != nullptr); BOOST_REQUIRE(vehicle != nullptr);

View File

@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(test_activities) {
} }
{ {
VehicleObject* vehicle = Global::get().e->createVehicle( VehicleObject* vehicle = Global::get().e->createVehicle(
90u, glm::vec3(10.f, 0.f, 0.f), glm::quat()); 90u, glm::vec3(10.f, 0.f, 0.f), glm::quat{1.0f,0.0f,0.0f,0.0f});
BOOST_REQUIRE(vehicle != nullptr); BOOST_REQUIRE(vehicle != nullptr);
BOOST_REQUIRE(vehicle->getModel() != nullptr); BOOST_REQUIRE(vehicle->getModel() != nullptr);

View File

@ -12,7 +12,7 @@ BOOST_AUTO_TEST_CASE(instance_test_damage)
std::shared_ptr<ObjectData> object(new ObjectData); std::shared_ptr<ObjectData> object(new ObjectData);
InstanceObject inst(Global::get().e, InstanceObject inst(Global::get().e,
glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f, 0.f, 0.f),
glm::quat(), nullptr, glm::quat{1.0f,0.0f,0.0f,0.0f}, nullptr,
glm::vec3(1.f), glm::vec3(1.f),
object, nullptr, nullptr object, nullptr, nullptr
); );
@ -35,7 +35,7 @@ BOOST_AUTO_TEST_CASE(instance_test_destroy)
std::shared_ptr<ObjectData> object(new ObjectData); std::shared_ptr<ObjectData> object(new ObjectData);
InstanceObject inst(Global::get().e, InstanceObject inst(Global::get().e,
glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f, 0.f, 0.f),
glm::quat(), nullptr, glm::quat{1.0f,0.0f,0.0f,0.0f}, nullptr,
glm::vec3(1.f), glm::vec3(1.f),
object, nullptr, nullptr object, nullptr, nullptr
); );

View File

@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE(test_available_nodes) {
{PathNode::EXTERNAL, -1, {-10.f, 10.f, 0.f}, 1.f, 0, 0}, {PathNode::EXTERNAL, -1, {-10.f, 10.f, 0.f}, 1.f, 0, 0},
}}; }};
graph.createPathNodes(glm::vec3(), glm::quat(), path); graph.createPathNodes(glm::vec3(), glm::quat{1.0f,0.0f,0.0f,0.0f}, path);
TrafficDirector director(&graph, Global::get().e); TrafficDirector director(&graph, Global::get().e);
@ -66,7 +66,7 @@ BOOST_AUTO_TEST_CASE(test_node_not_blocking) {
{PathNode::EXTERNAL, 1, {10.f, 10.f, 0.f}, 1.f, 0, 0}, {PathNode::EXTERNAL, 1, {10.f, 10.f, 0.f}, 1.f, 0, 0},
}}; }};
graph.createPathNodes(glm::vec3(), glm::quat(), path); graph.createPathNodes(glm::vec3(), glm::quat{1.0f,0.0f,0.0f,0.0f}, path);
TrafficDirector director(&graph, Global::get().e); TrafficDirector director(&graph, Global::get().e);
@ -93,7 +93,7 @@ BOOST_AUTO_TEST_CASE(test_node_blocking) {
{PathNode::EXTERNAL, 1, {10.f, 10.f, 0.f}, 1.f, 0, 0}, {PathNode::EXTERNAL, 1, {10.f, 10.f, 0.f}, 1.f, 0, 0},
}}; }};
graph.createPathNodes(glm::vec3(), glm::quat(), path); graph.createPathNodes(glm::vec3(), glm::quat{1.0f,0.0f,0.0f,0.0f}, path);
TrafficDirector director(&graph, Global::get().e); TrafficDirector director(&graph, Global::get().e);
@ -120,7 +120,7 @@ BOOST_AUTO_TEST_CASE(test_node_density) {
{PathNode::EXTERNAL, 1, {10.f, 10.f, 0.f}, 1.f, 0, 0}, {PathNode::EXTERNAL, 1, {10.f, 10.f, 0.f}, 1.f, 0, 0},
}}; }};
graph.createPathNodes(glm::vec3(), glm::quat(), path); graph.createPathNodes(glm::vec3(), glm::quat{1.0f,0.0f,0.0f,0.0f}, path);
TrafficDirector director(&graph, Global::get().e); TrafficDirector director(&graph, Global::get().e);
@ -154,7 +154,7 @@ BOOST_AUTO_TEST_CASE(test_create_traffic) {
{PathNode::EXTERNAL, 1, {10.f, 10.f, 0.f}, 1.f, 0, 0}, {PathNode::EXTERNAL, 1, {10.f, 10.f, 0.f}, 1.f, 0, 0},
}}; }};
graph.createPathNodes(glm::vec3(), glm::quat(), path); graph.createPathNodes(glm::vec3(), glm::quat{1.0f,0.0f,0.0f,0.0f}, path);
TrafficDirector director(&graph, Global::get().e); TrafficDirector director(&graph, Global::get().e);

View File

@ -8,7 +8,7 @@ BOOST_AUTO_TEST_SUITE(VehicleTests)
#if RW_TEST_WITH_DATA #if RW_TEST_WITH_DATA
BOOST_AUTO_TEST_CASE(test_create_vehicle) { BOOST_AUTO_TEST_CASE(test_create_vehicle) {
VehicleObject* vehicle = VehicleObject* vehicle =
Global::get().e->createVehicle(90u, glm::vec3(), glm::quat()); Global::get().e->createVehicle(90u, glm::vec3(), glm::quat{1.0f,0.0f,0.0f,0.0f});
BOOST_REQUIRE(vehicle != nullptr); BOOST_REQUIRE(vehicle != nullptr);
@ -28,7 +28,7 @@ BOOST_AUTO_TEST_CASE(test_create_vehicle) {
BOOST_AUTO_TEST_CASE(vehicle_parts) { BOOST_AUTO_TEST_CASE(vehicle_parts) {
VehicleObject* vehicle = VehicleObject* vehicle =
Global::get().e->createVehicle(90u, glm::vec3(), glm::quat()); Global::get().e->createVehicle(90u, glm::vec3(), glm::quat{1.0f,0.0f,0.0f,0.0f});
BOOST_REQUIRE(vehicle != nullptr); BOOST_REQUIRE(vehicle != nullptr);
BOOST_REQUIRE(vehicle->getModel() != nullptr); BOOST_REQUIRE(vehicle->getModel() != nullptr);
@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE(vehicle_parts) {
BOOST_AUTO_TEST_CASE(vehicle_part_vis) { BOOST_AUTO_TEST_CASE(vehicle_part_vis) {
VehicleObject* vehicle = VehicleObject* vehicle =
Global::get().e->createVehicle(90u, glm::vec3(), glm::quat()); Global::get().e->createVehicle(90u, glm::vec3(), glm::quat{1.0f,0.0f,0.0f,0.0f});
BOOST_REQUIRE(vehicle != nullptr); BOOST_REQUIRE(vehicle != nullptr);
BOOST_REQUIRE(vehicle->getModel() != nullptr); BOOST_REQUIRE(vehicle->getModel() != nullptr);
@ -73,7 +73,7 @@ BOOST_AUTO_TEST_CASE(vehicle_part_vis) {
BOOST_AUTO_TEST_CASE(test_door_position) { BOOST_AUTO_TEST_CASE(test_door_position) {
VehicleObject* vehicle = Global::get().e->createVehicle( VehicleObject* vehicle = Global::get().e->createVehicle(
90u, glm::vec3(10.f, 0.f, 0.f), glm::quat()); 90u, glm::vec3(10.f, 0.f, 0.f), glm::quat{1.0f,0.0f,0.0f,0.0f});
BOOST_REQUIRE(vehicle != nullptr); BOOST_REQUIRE(vehicle != nullptr);
@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE(test_door_position) {
BOOST_AUTO_TEST_CASE(test_hinges) { BOOST_AUTO_TEST_CASE(test_hinges) {
VehicleObject* vehicle = Global::get().e->createVehicle( VehicleObject* vehicle = Global::get().e->createVehicle(
90u, glm::vec3(10.f, 0.f, 0.f), glm::quat()); 90u, glm::vec3(10.f, 0.f, 0.f), glm::quat{1.0f,0.0f,0.0f,0.0f});
BOOST_REQUIRE(vehicle != nullptr); BOOST_REQUIRE(vehicle != nullptr);
@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE(test_hinges) {
BOOST_AUTO_TEST_CASE(test_open_part) { BOOST_AUTO_TEST_CASE(test_open_part) {
VehicleObject* vehicle = Global::get().e->createVehicle( VehicleObject* vehicle = Global::get().e->createVehicle(
90u, glm::vec3(10.f, 0.f, 0.f), glm::quat()); 90u, glm::vec3(10.f, 0.f, 0.f), glm::quat{1.0f,0.0f,0.0f,0.0f});
BOOST_REQUIRE(vehicle != nullptr); BOOST_REQUIRE(vehicle != nullptr);