Esempio n. 1
0
Placeable::Placeable(Urho3D::Context* context, Scene* scene) :
    IComponent(context, scene),
    attached_(false),
    INIT_ATTRIBUTE(transform, "Transform"),
    INIT_ATTRIBUTE_VALUE(drawDebug, "Show bounding box", false),
    INIT_ATTRIBUTE_VALUE(visible, "Visible", true),
    INIT_ATTRIBUTE_VALUE(selectionLayer, "Selection layer", 1),
    INIT_ATTRIBUTE_VALUE(parentRef, "Parent entity ref", EntityReference()),
    INIT_ATTRIBUTE_VALUE(parentBone, "Parent bone name", "")
{
    // Enable network interpolation for the transform
    static AttributeMetadata transAttrData;
    static AttributeMetadata nonDesignableAttrData;
    static bool metadataInitialized = false;
    if(!metadataInitialized)
    {
        transAttrData.interpolation = AttributeMetadata::Interpolate;
        nonDesignableAttrData.designable = false;
        metadataInitialized = true;
    }
    transform.SetMetadata(&transAttrData);

    ParentEntitySet.Connect(this, &Placeable::RegisterActions);
}
Esempio n. 2
0
template<> EntityReference TUNDRACORE_API Attribute<EntityReference>::DefaultValue() const { return EntityReference(); }
Esempio n. 3
0
template<> void TUNDRACORE_API Attribute<EntityReference>::FromString(const std::string& str, AttributeChange::Type change)
{
    Set(EntityReference(str.c_str()), change);
}