Models with Shield and shielded component now added to queues
This commit is contained in:
@@ -40,7 +40,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="7364.7876" Z="0"/>
|
<Orientation X="0" Y="7364.78809" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="2019.28516" Z="0"/>
|
<Orientation X="0" Y="2019.28528" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -683,7 +683,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.504547" Z="0"/>
|
<Orientation X="0" Y="316.5047" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -730,7 +730,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.504547" Z="0"/>
|
<Orientation X="0" Y="316.5047" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -790,7 +790,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.504547" Z="0"/>
|
<Orientation X="0" Y="316.5047" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -837,7 +837,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.504547" Z="0"/>
|
<Orientation X="0" Y="316.5047" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -883,7 +883,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.504547" Z="0"/>
|
<Orientation X="0" Y="316.5047" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -930,7 +930,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.504547" Z="0"/>
|
<Orientation X="0" Y="316.5047" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -977,7 +977,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="316.504547" Z="0"/>
|
<Orientation X="0" Y="316.5047" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -1377,7 +1377,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="850.206909" Z="0"/>
|
<Orientation X="0" Y="850.207092" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -1386,7 +1386,7 @@
|
|||||||
<c:ExplosionEffect>
|
<c:ExplosionEffect>
|
||||||
<ColorByDistance>true</ColorByDistance>
|
<ColorByDistance>true</ColorByDistance>
|
||||||
<Velocity X="0.800000012" Y="0.0379999988" Z="0"/>
|
<Velocity X="0.800000012" Y="0.0379999988" Z="0"/>
|
||||||
<TimeSinceDeath>0.7502397033169681</TimeSinceDeath>
|
<TimeSinceDeath>0.75055150002244431</TimeSinceDeath>
|
||||||
<ExplosionDuration>3.7999999523162842</ExplosionDuration>
|
<ExplosionDuration>3.7999999523162842</ExplosionDuration>
|
||||||
<EndColor A="0" B="23.5294113" G="11.7647057" R="0"/>
|
<EndColor A="0" B="23.5294113" G="11.7647057" R="0"/>
|
||||||
<Randomness>true</Randomness>
|
<Randomness>true</Randomness>
|
||||||
@@ -1433,7 +1433,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="850.206909" Z="0"/>
|
<Orientation X="0" Y="850.207092" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -1442,7 +1442,7 @@
|
|||||||
<c:ExplosionEffect>
|
<c:ExplosionEffect>
|
||||||
<Velocity X="0.5" Y="1" Z="0"/>
|
<Velocity X="0.5" Y="1" Z="0"/>
|
||||||
<ExplosionOrigin X="0" Y="0.900000036" Z="0"/>
|
<ExplosionOrigin X="0" Y="0.900000036" Z="0"/>
|
||||||
<TimeSinceDeath>1.2001454539310752</TimeSinceDeath>
|
<TimeSinceDeath>1.2004572506365514</TimeSinceDeath>
|
||||||
</c:ExplosionEffect>
|
</c:ExplosionEffect>
|
||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Assault.mesh</Resource>
|
<Resource>Models/Assault.mesh</Resource>
|
||||||
@@ -1485,7 +1485,7 @@
|
|||||||
<Axis X="0" Y="1" Z="0"/>
|
<Axis X="0" Y="1" Z="0"/>
|
||||||
</c:RaptorCopter>
|
</c:RaptorCopter>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Orientation X="0" Y="850.206909" Z="0"/>
|
<Orientation X="0" Y="850.207092" Z="0"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
</Components>
|
</Components>
|
||||||
<Children>
|
<Children>
|
||||||
@@ -1500,7 +1500,7 @@
|
|||||||
<ColorByDistance>true</ColorByDistance>
|
<ColorByDistance>true</ColorByDistance>
|
||||||
<Velocity X="0.300000012" Y="2" Z="0"/>
|
<Velocity X="0.300000012" Y="2" Z="0"/>
|
||||||
<ExplosionOrigin X="0" Y="1.30000007" Z="-0.200000003"/>
|
<ExplosionOrigin X="0" Y="1.30000007" Z="-0.200000003"/>
|
||||||
<TimeSinceDeath>0.68359123759100648</TimeSinceDeath>
|
<TimeSinceDeath>0.68390303429648269</TimeSinceDeath>
|
||||||
<EndColor A="0" B="0.333333343" G="0.933333337" R="3.92156863"/>
|
<EndColor A="0" B="0.333333343" G="0.933333337" R="3.92156863"/>
|
||||||
<Randomness>true</Randomness>
|
<Randomness>true</Randomness>
|
||||||
</c:ExplosionEffect>
|
</c:ExplosionEffect>
|
||||||
@@ -1581,6 +1581,7 @@
|
|||||||
<c:Model>
|
<c:Model>
|
||||||
<Resource>Models/Core/UnitCube.mesh</Resource>
|
<Resource>Models/Core/UnitCube.mesh</Resource>
|
||||||
</c:Model>
|
</c:Model>
|
||||||
|
<c:Shielded/>
|
||||||
<c:Transform>
|
<c:Transform>
|
||||||
<Position X="-3.34650159" Y="1.19966424" Z="3.09996605"/>
|
<Position X="-3.34650159" Y="1.19966424" Z="3.09996605"/>
|
||||||
</c:Transform>
|
</c:Transform>
|
||||||
@@ -1690,6 +1691,7 @@
|
|||||||
<c:ExplosionEffect>
|
<c:ExplosionEffect>
|
||||||
<ColorByDistance>true</ColorByDistance>
|
<ColorByDistance>true</ColorByDistance>
|
||||||
<Velocity X="0.800000012" Y="0.0379999988" Z="0"/>
|
<Velocity X="0.800000012" Y="0.0379999988" Z="0"/>
|
||||||
|
<TimeSinceDeath>0.0003117967054762083</TimeSinceDeath>
|
||||||
<ExplosionDuration>3.7999999523162842</ExplosionDuration>
|
<ExplosionDuration>3.7999999523162842</ExplosionDuration>
|
||||||
<EndColor A="0" B="23.5294113" G="11.7647057" R="0"/>
|
<EndColor A="0" B="23.5294113" G="11.7647057" R="0"/>
|
||||||
<Randomness>true</Randomness>
|
<Randomness>true</Randomness>
|
||||||
|
|||||||
@@ -92,7 +92,9 @@ void RenderSystem::fillModels(RenderScene::Queues &Jobs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
glm::mat4 modelMatrix = Transform::ModelMatrix(cModel.EntityID, m_World);
|
glm::mat4 modelMatrix = Transform::ModelMatrix(cModel.EntityID, m_World);
|
||||||
|
//Loop through all materialgroups of a model
|
||||||
for (auto matGroup : model->MaterialGroups()) {
|
for (auto matGroup : model->MaterialGroups()) {
|
||||||
|
//If the model has an explosioneffect component, we will add an explosioneffectjob
|
||||||
if (m_World->HasComponent(cModel.EntityID, "ExplosionEffect")) {
|
if (m_World->HasComponent(cModel.EntityID, "ExplosionEffect")) {
|
||||||
auto explosionEffectComponent = m_World->GetComponent(cModel.EntityID, "ExplosionEffect");
|
auto explosionEffectComponent = m_World->GetComponent(cModel.EntityID, "ExplosionEffect");
|
||||||
std::shared_ptr<ExplosionEffectJob> explosionEffectJob = std::shared_ptr<ExplosionEffectJob>(new ExplosionEffectJob(
|
std::shared_ptr<ExplosionEffectJob> explosionEffectJob = std::shared_ptr<ExplosionEffectJob>(new ExplosionEffectJob(
|
||||||
@@ -106,15 +108,30 @@ void RenderSystem::fillModels(RenderScene::Queues &Jobs)
|
|||||||
fillColor,
|
fillColor,
|
||||||
fillPercentage
|
fillPercentage
|
||||||
));
|
));
|
||||||
|
if (m_World->HasComponent(cModel.EntityID, "Shield")){
|
||||||
|
Jobs.ShieldObjects.push_back(explosionEffectJob);
|
||||||
|
} else if (m_World->HasComponent(cModel.EntityID, "Shielded")
|
||||||
|
|| m_World->HasComponent(cModel.EntityID, "Player")) {
|
||||||
|
|
||||||
if(explosionEffectJob->Color.a != 1.f || explosionEffectJob->EndColor.a != 1.f || explosionEffectJob->DiffuseColor.a != 1.f) {
|
if (explosionEffectJob->Color.a != 1.f || explosionEffectJob->EndColor.a != 1.f || explosionEffectJob->DiffuseColor.a != 1.f) {
|
||||||
cModel["Transparent"] = true;
|
cModel["Transparent"] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cModel["Transparent"]) {
|
if (cModel["Transparent"]) {
|
||||||
Jobs.TransparentObjects.push_back(explosionEffectJob);
|
Jobs.TransparentShieldedObjects.push_back(explosionEffectJob);
|
||||||
|
} else {
|
||||||
|
Jobs.OpaqueShieldedObjects.push_back(explosionEffectJob);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Jobs.OpaqueObjects.push_back(explosionEffectJob);
|
if (explosionEffectJob->Color.a != 1.f || explosionEffectJob->EndColor.a != 1.f || explosionEffectJob->DiffuseColor.a != 1.f) {
|
||||||
|
cModel["Transparent"] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cModel["Transparent"]) {
|
||||||
|
Jobs.TransparentObjects.push_back(explosionEffectJob);
|
||||||
|
} else {
|
||||||
|
Jobs.OpaqueObjects.push_back(explosionEffectJob);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
std::shared_ptr<ModelJob> modelJob = std::shared_ptr<ModelJob>(new ModelJob(
|
std::shared_ptr<ModelJob> modelJob = std::shared_ptr<ModelJob>(new ModelJob(
|
||||||
@@ -127,13 +144,30 @@ void RenderSystem::fillModels(RenderScene::Queues &Jobs)
|
|||||||
fillColor,
|
fillColor,
|
||||||
fillPercentage
|
fillPercentage
|
||||||
));
|
));
|
||||||
if (modelJob->Color.a != 1.f || modelJob->DiffuseColor.a != 1.f) {
|
if (m_World->HasComponent(cModel.EntityID, "Shield")) {
|
||||||
cModel["Transparent"] = true;
|
Jobs.ShieldObjects.push_back(modelJob);
|
||||||
}
|
} else if (m_World->HasComponent(cModel.EntityID, "Shielded")
|
||||||
if (cModel["Transparent"]) {
|
|| m_World->HasComponent(cModel.EntityID, "Player")) {
|
||||||
Jobs.TransparentObjects.push_back(modelJob);
|
|
||||||
|
if (modelJob->Color.a != 1.f || modelJob->DiffuseColor.a != 1.f) {
|
||||||
|
cModel["Transparent"] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cModel["Transparent"]) {
|
||||||
|
Jobs.TransparentShieldedObjects.push_back(modelJob);
|
||||||
|
} else {
|
||||||
|
Jobs.OpaqueShieldedObjects.push_back(modelJob);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Jobs.OpaqueObjects.push_back(modelJob);
|
if (modelJob->Color.a != 1.f || modelJob->DiffuseColor.a != 1.f) {
|
||||||
|
cModel["Transparent"] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cModel["Transparent"]) {
|
||||||
|
Jobs.TransparentObjects.push_back(modelJob);
|
||||||
|
} else {
|
||||||
|
Jobs.OpaqueObjects.push_back(modelJob);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user