Exemplo n.º 1
0
void Pointer::update(unsigned int pointerID) {
    // This only needs to be a read lock because update won't change any of the properties that can be modified from scripts
    withReadLock([&] {
        auto pickResult = getPrevPickResult();
        // Pointer needs its own PickResult object so it doesn't modify the cached pick result
        auto visualPickResult = getVisualPickResult(getPickResultCopy(pickResult));
        updateVisuals(visualPickResult);
        generatePointerEvents(pointerID, visualPickResult);
    });
}
Exemplo n.º 2
0
Transform RayPick::getResultTransform() const {
    PickResultPointer result = getPrevPickResult();
    if (!result) {
        return Transform();
    }

    auto rayResult = std::static_pointer_cast<RayPickResult>(result);
    Transform transform;
    transform.setTranslation(rayResult->intersection);
    return transform;
}