mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 12:14:00 +02:00
Check if pick result is null when building visual pick result
This commit is contained in:
parent
8dd36e465b
commit
660bdf36d0
3 changed files with 9 additions and 0 deletions
|
@ -36,6 +36,9 @@ void LaserPointer::editRenderStatePath(const std::string& state, const QVariant&
|
|||
}
|
||||
|
||||
PickResultPointer LaserPointer::getPickResultCopy(const PickResultPointer& pickResult) const {
|
||||
if (!pickResult) {
|
||||
std::make_shared<RayPickResult>();
|
||||
}
|
||||
auto rayPickResult = std::static_pointer_cast<RayPickResult>(pickResult);
|
||||
return std::make_shared<RayPickResult>(*rayPickResult.get());
|
||||
}
|
||||
|
|
|
@ -31,6 +31,9 @@ ParabolaPointer::ParabolaPointer(const QVariant& rayProps, const RenderStateMap&
|
|||
}
|
||||
|
||||
PickResultPointer ParabolaPointer::getPickResultCopy(const PickResultPointer& pickResult) const {
|
||||
if (!pickResult) {
|
||||
std::make_shared<ParabolaPickResult>();
|
||||
}
|
||||
auto stylusPickResult = std::static_pointer_cast<ParabolaPickResult>(pickResult);
|
||||
return std::make_shared<ParabolaPickResult>(*stylusPickResult.get());
|
||||
}
|
||||
|
|
|
@ -148,6 +148,9 @@ bool StylusPointer::shouldTrigger(const PickResultPointer& pickResult) {
|
|||
}
|
||||
|
||||
PickResultPointer StylusPointer::getPickResultCopy(const PickResultPointer& pickResult) const {
|
||||
if (!pickResult) {
|
||||
std::make_shared<StylusPickResult>();
|
||||
}
|
||||
auto stylusPickResult = std::static_pointer_cast<StylusPickResult>(pickResult);
|
||||
return std::make_shared<StylusPickResult>(*stylusPickResult.get());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue