add the ability to exclude props from the selection size + add aura visualisation rings again
This was SVN commit r14497.
This commit is contained in:
parent
4b1297b328
commit
d4b2c1285c
@ -8,6 +8,7 @@
|
|||||||
<prop actor="props/structures/athenians/temple_decor.xml" attachpoint="root"/>
|
<prop actor="props/structures/athenians/temple_decor.xml" attachpoint="root"/>
|
||||||
<prop actor="props/structures/athenians/temple_props_a.xml" attachpoint="root"/>
|
<prop actor="props/structures/athenians/temple_props_a.xml" attachpoint="root"/>
|
||||||
<prop actor="props/structures/athenians/temple_tile_c.xml" attachpoint="root"/>
|
<prop actor="props/structures/athenians/temple_tile_c.xml" attachpoint="root"/>
|
||||||
|
<prop actor="props/special/common/aura_60_green_rays.xml" attachpoint="root"/>
|
||||||
</props>
|
</props>
|
||||||
<textures>
|
<textures>
|
||||||
<texture file="structural/hele_struct.dds" name="baseTex"/>
|
<texture file="structural/hele_struct.dds" name="baseTex"/>
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
<prop actor="props/units/weapons/spear_lance.xml" attachpoint="r_hand"/>
|
<prop actor="props/units/weapons/spear_lance.xml" attachpoint="r_hand"/>
|
||||||
<prop actor="props/units/shields/athen_aspis_pericles.xml" attachpoint="shield"/>
|
<prop actor="props/units/shields/athen_aspis_pericles.xml" attachpoint="shield"/>
|
||||||
<prop actor="props/units/cape_hd.xml" attachpoint="shoulders"/>
|
<prop actor="props/units/cape_hd.xml" attachpoint="shoulders"/>
|
||||||
|
<prop actor="props/special/common/aura_60_common.xml" attachpoint="root" selectable="false"/>
|
||||||
</props>
|
</props>
|
||||||
<textures><texture file="skeletal/hele_isp_e_f.dds" name="baseTex"/></textures>
|
<textures><texture file="skeletal/hele_isp_e_f.dds" name="baseTex"/></textures>
|
||||||
</variant>
|
</variant>
|
||||||
|
@ -208,7 +208,7 @@ const CBoundingBoxAligned CModel::GetObjectSelectionBoundsRec()
|
|||||||
for (size_t i = 0; i < m_Props.size(); ++i)
|
for (size_t i = 0; i < m_Props.size(); ++i)
|
||||||
{
|
{
|
||||||
const Prop& prop = m_Props[i];
|
const Prop& prop = m_Props[i];
|
||||||
if (prop.m_Hidden)
|
if (prop.m_Hidden || !prop.m_Selectable)
|
||||||
continue; // prop is hidden from rendering, so it also shouldn't be used for selection
|
continue; // prop is hidden from rendering, so it also shouldn't be used for selection
|
||||||
|
|
||||||
CBoundingBoxAligned propSelectionBounds = prop.m_Model->GetObjectSelectionBoundsRec();
|
CBoundingBoxAligned propSelectionBounds = prop.m_Model->GetObjectSelectionBoundsRec();
|
||||||
@ -400,7 +400,7 @@ void CModel::ValidatePosition()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Adjust prop height to terrain level when needed
|
// Adjust prop height to terrain level when needed
|
||||||
if (prop.m_maxHeight != 0.f || prop.m_minHeight != 0.f)
|
if (prop.m_MaxHeight != 0.f || prop.m_MinHeight != 0.f)
|
||||||
{
|
{
|
||||||
CVector3D propTranslation = proptransform.GetTranslation();
|
CVector3D propTranslation = proptransform.GetTranslation();
|
||||||
CVector3D objTranslation = m_Transform.GetTranslation();
|
CVector3D objTranslation = m_Transform.GetTranslation();
|
||||||
@ -410,8 +410,8 @@ void CModel::ValidatePosition()
|
|||||||
{
|
{
|
||||||
float objTerrain = cmpTerrain->GetExactGroundLevel(objTranslation.X, objTranslation.Z);
|
float objTerrain = cmpTerrain->GetExactGroundLevel(objTranslation.X, objTranslation.Z);
|
||||||
float propTerrain = cmpTerrain->GetExactGroundLevel(propTranslation.X, propTranslation.Z);
|
float propTerrain = cmpTerrain->GetExactGroundLevel(propTranslation.X, propTranslation.Z);
|
||||||
float translateHeight = std::min(prop.m_maxHeight,
|
float translateHeight = std::min(prop.m_MaxHeight,
|
||||||
std::max(prop.m_minHeight, propTerrain - objTerrain));
|
std::max(prop.m_MinHeight, propTerrain - objTerrain));
|
||||||
CMatrix3D translate = CMatrix3D();
|
CMatrix3D translate = CMatrix3D();
|
||||||
translate.SetTranslation(0.f, translateHeight, 0.f);
|
translate.SetTranslation(0.f, translateHeight, 0.f);
|
||||||
proptransform.Concatenate(translate);
|
proptransform.Concatenate(translate);
|
||||||
@ -508,7 +508,7 @@ void CModel::CopyAnimationFrom(CModel* source)
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// AddProp: add a prop to the model on the given point
|
// AddProp: add a prop to the model on the given point
|
||||||
void CModel::AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry, float minHeight, float maxHeight)
|
void CModel::AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry, float minHeight, float maxHeight, bool selectable)
|
||||||
{
|
{
|
||||||
// position model according to prop point position
|
// position model according to prop point position
|
||||||
|
|
||||||
@ -520,8 +520,9 @@ void CModel::AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntr
|
|||||||
prop.m_Point = point;
|
prop.m_Point = point;
|
||||||
prop.m_Model = model;
|
prop.m_Model = model;
|
||||||
prop.m_ObjectEntry = objectentry;
|
prop.m_ObjectEntry = objectentry;
|
||||||
prop.m_minHeight = minHeight;
|
prop.m_MinHeight = minHeight;
|
||||||
prop.m_maxHeight = maxHeight;
|
prop.m_MaxHeight = maxHeight;
|
||||||
|
prop.m_Selectable = selectable;
|
||||||
m_Props.push_back(prop);
|
m_Props.push_back(prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -603,7 +604,7 @@ CModelAbstract* CModel::Clone() const
|
|||||||
if (m_AmmoPropPoint && i == m_AmmoLoadedProp)
|
if (m_AmmoPropPoint && i == m_AmmoLoadedProp)
|
||||||
clone->AddAmmoProp(m_Props[i].m_Point, m_Props[i].m_Model->Clone(), m_Props[i].m_ObjectEntry);
|
clone->AddAmmoProp(m_Props[i].m_Point, m_Props[i].m_Model->Clone(), m_Props[i].m_ObjectEntry);
|
||||||
else
|
else
|
||||||
clone->AddProp(m_Props[i].m_Point, m_Props[i].m_Model->Clone(), m_Props[i].m_ObjectEntry, m_Props[i].m_minHeight, m_Props[i].m_maxHeight);
|
clone->AddProp(m_Props[i].m_Point, m_Props[i].m_Model->Clone(), m_Props[i].m_ObjectEntry, m_Props[i].m_MinHeight, m_Props[i].m_MaxHeight, m_Props[i].m_Selectable);
|
||||||
}
|
}
|
||||||
|
|
||||||
return clone;
|
return clone;
|
||||||
|
@ -54,10 +54,10 @@ class CModel : public CModelAbstract
|
|||||||
public:
|
public:
|
||||||
struct Prop
|
struct Prop
|
||||||
{
|
{
|
||||||
Prop() : m_minHeight(0.f), m_maxHeight(0.f), m_Point(0), m_Model(0), m_ObjectEntry(0), m_Hidden(false) {}
|
Prop() : m_MinHeight(0.f), m_MaxHeight(0.f), m_Point(0), m_Model(0), m_ObjectEntry(0), m_Hidden(false), m_Selectable(true) {}
|
||||||
|
|
||||||
float m_minHeight;
|
float m_MinHeight;
|
||||||
float m_maxHeight;
|
float m_MaxHeight;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Location of the prop point within its parent model, relative to either a bone in the parent model or to the
|
* Location of the prop point within its parent model, relative to either a bone in the parent model or to the
|
||||||
@ -75,6 +75,7 @@ public:
|
|||||||
CObjectEntry* m_ObjectEntry;
|
CObjectEntry* m_ObjectEntry;
|
||||||
|
|
||||||
bool m_Hidden; ///< Should this prop be temporarily removed from rendering?
|
bool m_Hidden; ///< Should this prop be temporarily removed from rendering?
|
||||||
|
bool m_Selectable; /// < should this prop count in the selection size?
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -213,7 +214,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Add a prop to the model on the given point.
|
* Add a prop to the model on the given point.
|
||||||
*/
|
*/
|
||||||
void AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry, float minHeight = 0.f, float maxHeight = 0.f);
|
void AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry, float minHeight = 0.f, float maxHeight = 0.f, bool selectable = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a prop to the model on the given point, and treat it as the ammo prop.
|
* Add a prop to the model on the given point, and treat it as the ammo prop.
|
||||||
|
@ -82,6 +82,7 @@ bool CObjectBase::Load(const VfsPath& pathname)
|
|||||||
AT(offsetz);
|
AT(offsetz);
|
||||||
AT(minheight);
|
AT(minheight);
|
||||||
AT(maxheight);
|
AT(maxheight);
|
||||||
|
AT(selectable);
|
||||||
#undef AT
|
#undef AT
|
||||||
#undef EL
|
#undef EL
|
||||||
|
|
||||||
@ -252,6 +253,8 @@ bool CObjectBase::Load(const VfsPath& pathname)
|
|||||||
prop.m_minHeight = pe.Value.ToFloat();
|
prop.m_minHeight = pe.Value.ToFloat();
|
||||||
else if (pe.Name == at_maxheight)
|
else if (pe.Name == at_maxheight)
|
||||||
prop.m_maxHeight = pe.Value.ToFloat();
|
prop.m_maxHeight = pe.Value.ToFloat();
|
||||||
|
else if (pe.Name == at_selectable)
|
||||||
|
prop.m_selectable = pe.Value != "false";
|
||||||
}
|
}
|
||||||
currentVariant->m_Props.push_back(prop);
|
currentVariant->m_Props.push_back(prop);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ public:
|
|||||||
struct Prop
|
struct Prop
|
||||||
{
|
{
|
||||||
// constructor
|
// constructor
|
||||||
Prop() : m_minHeight(0.f), m_maxHeight(0.f) {}
|
Prop() : m_minHeight(0.f), m_maxHeight(0.f), m_selectable(true) {}
|
||||||
// name of the prop point to attach to - "Prop01", "Prop02", "Head", "LeftHand", etc ..
|
// name of the prop point to attach to - "Prop01", "Prop02", "Head", "LeftHand", etc ..
|
||||||
CStr m_PropPointName;
|
CStr m_PropPointName;
|
||||||
// name of the model file - art/actors/props/sword.xml or whatever
|
// name of the model file - art/actors/props/sword.xml or whatever
|
||||||
@ -64,6 +64,7 @@ public:
|
|||||||
// allow the prop to ajust the height from minHeight to maxHeight relative to the main model
|
// allow the prop to ajust the height from minHeight to maxHeight relative to the main model
|
||||||
float m_minHeight;
|
float m_minHeight;
|
||||||
float m_maxHeight;
|
float m_maxHeight;
|
||||||
|
bool m_selectable;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Samp
|
struct Samp
|
||||||
|
@ -235,7 +235,7 @@ bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
|||||||
if (isAmmo)
|
if (isAmmo)
|
||||||
model->AddAmmoProp(proppoint, propmodel, oe);
|
model->AddAmmoProp(proppoint, propmodel, oe);
|
||||||
else
|
else
|
||||||
model->AddProp(proppoint, propmodel, oe, prop.m_minHeight, prop.m_maxHeight);
|
model->AddProp(proppoint, propmodel, oe, prop.m_minHeight, prop.m_maxHeight, prop.m_selectable);
|
||||||
if (propmodel->ToCModel())
|
if (propmodel->ToCModel())
|
||||||
propmodel->ToCModel()->SetAnimation(oe->GetRandomAnimation("idle"));
|
propmodel->ToCModel()->SetAnimation(oe->GetRandomAnimation("idle"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user