Skip to content

Removal of Inherited Attributes and Tags

Each tag has the _noinherit and _inheritRemove attributes:

  • _noinherit="true" – removes attributes and child tags (inherited from the template) from the tag where it is used.

  • _inheritRemove="true" – removes the tag itself.

For example:

<_templates>
    <Body>
        <MyTemplate4 Mass="5">
            <Constraint Type="Fixed" />
            <Body Mass="1">
                <Constraint Type="Hinge" />
                <Body Mass="2">
                    <Constraint Type="Ragdoll" />
                </Body>
            </Body>
        </MyTemplate4>
    </Body>
</_templates>
<Truck>
    <PhysicsModel Mesh="trucks/example_truck">
        <Body Mass="10">
            <Body _template="MyTemplate4">
                <Body _noinherit="true" ImpactType="Truck">
                    <Constraint Type="Prismatic" />
                </Body>
            </Body>
            <Body _template="MyTemplate4">
                <Body _inheritRemove="true" />
            </Body>
        </Body>
    </PhysicsModel>
    ...
</Truck>

The same piece of XML without the template will look like the following:

<Truck>
    <PhysicsModel Mesh="trucks/example_truck">
        <Body Mass="10">
            <Body Mass="1">
                <Constraint Type="Fixed" />
                <Body ImpactType="Truck">
                    <Constraint Type="Prismatic" />
                </Body>
            </Body>
            <Body Mass="1">
                <Constraint Type="Fixed" />
            </Body>
        </Body>
    </PhysicsModel>
    ...
</Truck>