Ejemplo n.º 1
0
Any Entity::toAny() const {
    Any a = m_sourceAny;
    debugAssert(! a.isNil());
    if (a.isNil()) {
        // Fallback for release mode failure
        return a;
    }

    if (m_movedSinceLoad) {
        a["frame"] = m_frame;
    }

    const shared_ptr<SplineTrack>& splineTrack = dynamic_pointer_cast<SplineTrack>(m_track);
    if (notNull(splineTrack) && splineTrack->changed()) {
        // Update the spline
        const PhysicsFrameSpline& spline = splineTrack->spline();
        if (spline.control.size() == 1) {
            // Write out in short form for the single control point
            const PhysicsFrame& p = spline.control[0];
            if (p.rotation == Quat()) {
                // No rotation
                a["track"] = p.translation;
            } else {
                // Full coordinate frame
                a["track"] = CFrame(p);
            }
        } else {
            // Write the full spline
            a["track"] = spline;
        }
    }

    a.setName("Entity");
    return a;
}
Ejemplo n.º 2
0
Any MarkerEntity::toAny() const {
    Any a = Entity::toAny();
    a.setName("MarkerEntity");
    a["color"] = m_color;
    a["osBoxArray"] = m_osBoxArray;

    return a;
}
Ejemplo n.º 3
0
Any PlayerEntity::toAny(const bool forceAll) const {
    Any a = VisibleEntity::toAny(forceAll);
    a.setName("PlayerEntity");

    a["velocity"] = m_velocity;

    return a;
}
Ejemplo n.º 4
0
Any VisibleEntity::toAny() const {
    Any a = Entity::toAny();
    a.setName("VisibleEntity");
    a.set("visible", m_visible);

    // Model and pose must already have been set, so no need to change anything
    return a;
}
Ejemplo n.º 5
0
Any PlayerEntity::toAny() const {
    Any a = VisibleEntity::toAny();
    a.setName("PlayerEntity");

    a["velocity"] = m_velocity;
    a["collisionSphere"] = m_collisionProxySphere;

    return a;
}
Ejemplo n.º 6
0
Any Camera::toAny() const {
    Any any = Entity::toAny();
    
    any.setName("Camera");

    any["projection"]           = m_projection;
    any["depthOfFieldSettings"] = m_depthOfFieldSettings;
    any["motionBlurSettings"]   = m_motionBlurSettings;
    any["filmSettings"]         = m_filmSettings;
    any["visualizationScale"]   = m_visualizationScale;
    return any;
}
Ejemplo n.º 7
0
Any VisibleEntity::toAny(const bool forceAll) const {
    Any a = Entity::toAny(forceAll);
    a.setName("VisibleEntity");

    AnyTableReader oldValues(a);
    bool visible;
    if (forceAll || (oldValues.getIfPresent("visible", visible) && visible != m_visible)) {
        a.set("visible", m_visible);
    }

    // Model and pose must already have been set, so no need to change anything
    return a;
}