Added Unpickable component, which skips the entity in the PickingPass
This commit is contained in:
@@ -121,12 +121,17 @@ struct ModelJob : RenderJob
|
|||||||
FillPercentage = fillPercentage;
|
FillPercentage = fillPercentage;
|
||||||
IsShielded = isShielded;
|
IsShielded = isShielded;
|
||||||
|
|
||||||
|
|
||||||
|
if (world->HasComponent(Entity, "Unpickable")) {
|
||||||
|
NotPickable = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (model->IsSkinned()) {
|
if (model->IsSkinned()) {
|
||||||
Skeleton = Model->m_RawModel->m_Skeleton;
|
Skeleton = Model->m_RawModel->m_Skeleton;
|
||||||
|
|
||||||
if (Skeleton != nullptr) {
|
if (Skeleton != nullptr) {
|
||||||
|
|
||||||
EntityWrapper entityWrapper = EntityWrapper(world, modelComponent.EntityID);
|
EntityWrapper entityWrapper = EntityWrapper(world, modelComponent.EntityID);
|
||||||
|
|
||||||
|
|
||||||
if(Skeleton->BlendTrees.find(entityWrapper) != Skeleton->BlendTrees.end()) {
|
if(Skeleton->BlendTrees.find(entityWrapper) != Skeleton->BlendTrees.end()) {
|
||||||
BlendTree = Skeleton->BlendTrees.at(entityWrapper);
|
BlendTree = Skeleton->BlendTrees.at(entityWrapper);
|
||||||
@@ -164,6 +169,7 @@ struct ModelJob : RenderJob
|
|||||||
float FillPercentage = 0.0;
|
float FillPercentage = 0.0;
|
||||||
bool IsShielded;
|
bool IsShielded;
|
||||||
bool Shadow;
|
bool Shadow;
|
||||||
|
bool NotPickable = false;
|
||||||
|
|
||||||
void CalculateHash() override
|
void CalculateHash() override
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -68,4 +68,5 @@
|
|||||||
<xs:include schemaLocation="Components/NetworkComponent.xsd"/>
|
<xs:include schemaLocation="Components/NetworkComponent.xsd"/>
|
||||||
<xs:include schemaLocation="Components/ServerIdentity.xsd"/>
|
<xs:include schemaLocation="Components/ServerIdentity.xsd"/>
|
||||||
<xs:include schemaLocation="Components/ServerList.xsd"/>
|
<xs:include schemaLocation="Components/ServerList.xsd"/>
|
||||||
|
<xs:include schemaLocation="Components/Unpickable.xsd"/>
|
||||||
</xs:schema>
|
</xs:schema>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
||||||
|
<Unpickable xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Unpickable.xsd">
|
||||||
|
</Unpickable>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="types">
|
||||||
|
<xs:import schemaLocation="../Types.xsd" namespace="types"/>
|
||||||
|
|
||||||
|
<xs:element name="Unpickable">
|
||||||
|
<xs:annotation>
|
||||||
|
<xs:documentation>Makes the entity unpickable</xs:documentation>
|
||||||
|
</xs:annotation>
|
||||||
|
</xs:element>
|
||||||
|
</xs:schema>
|
||||||
@@ -71,6 +71,7 @@
|
|||||||
<xs:element ref="c:NetworkComponent" minOccurs="0"/>
|
<xs:element ref="c:NetworkComponent" minOccurs="0"/>
|
||||||
<xs:element ref="c:ServerIdentity" minOccurs="0"/>
|
<xs:element ref="c:ServerIdentity" minOccurs="0"/>
|
||||||
<xs:element ref="c:ServerList" minOccurs="0"/>
|
<xs:element ref="c:ServerList" minOccurs="0"/>
|
||||||
|
<xs:element ref="c:Unpickable" minOccurs="0"/>
|
||||||
</xs:all>
|
</xs:all>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|||||||
@@ -76,6 +76,11 @@ void PickingPass::Draw(RenderScene& scene)
|
|||||||
auto modelJob = std::dynamic_pointer_cast<ModelJob>(job);
|
auto modelJob = std::dynamic_pointer_cast<ModelJob>(job);
|
||||||
|
|
||||||
if (modelJob) {
|
if (modelJob) {
|
||||||
|
if(modelJob->NotPickable) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int pickColor[2] = { m_ColorCounter[0], m_ColorCounter[1] };
|
int pickColor[2] = { m_ColorCounter[0], m_ColorCounter[1] };
|
||||||
|
|
||||||
PickingInfo pickInfo;
|
PickingInfo pickInfo;
|
||||||
|
|||||||
Reference in New Issue
Block a user