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