mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 16:23:39 +02:00
Check type in Pointer::getPickResultCopy
This commit is contained in:
parent
660bdf36d0
commit
6e83e96d1c
3 changed files with 7 additions and 7 deletions
|
@ -36,10 +36,10 @@ void LaserPointer::editRenderStatePath(const std::string& state, const QVariant&
|
|||
}
|
||||
|
||||
PickResultPointer LaserPointer::getPickResultCopy(const PickResultPointer& pickResult) const {
|
||||
if (!pickResult) {
|
||||
auto rayPickResult = std::dynamic_pointer_cast<RayPickResult>(pickResult);
|
||||
if (!rayPickResult) {
|
||||
std::make_shared<RayPickResult>();
|
||||
}
|
||||
auto rayPickResult = std::static_pointer_cast<RayPickResult>(pickResult);
|
||||
return std::make_shared<RayPickResult>(*rayPickResult.get());
|
||||
}
|
||||
|
||||
|
|
|
@ -31,11 +31,11 @@ ParabolaPointer::ParabolaPointer(const QVariant& rayProps, const RenderStateMap&
|
|||
}
|
||||
|
||||
PickResultPointer ParabolaPointer::getPickResultCopy(const PickResultPointer& pickResult) const {
|
||||
if (!pickResult) {
|
||||
auto parabolaPickResult = std::dynamic_pointer_cast<ParabolaPickResult>(pickResult);
|
||||
if (!parabolaPickResult) {
|
||||
std::make_shared<ParabolaPickResult>();
|
||||
}
|
||||
auto stylusPickResult = std::static_pointer_cast<ParabolaPickResult>(pickResult);
|
||||
return std::make_shared<ParabolaPickResult>(*stylusPickResult.get());
|
||||
return std::make_shared<ParabolaPickResult>(*parabolaPickResult.get());
|
||||
}
|
||||
|
||||
void ParabolaPointer::editRenderStatePath(const std::string& state, const QVariant& pathProps) {
|
||||
|
|
|
@ -148,10 +148,10 @@ bool StylusPointer::shouldTrigger(const PickResultPointer& pickResult) {
|
|||
}
|
||||
|
||||
PickResultPointer StylusPointer::getPickResultCopy(const PickResultPointer& pickResult) const {
|
||||
if (!pickResult) {
|
||||
auto stylusPickResult = std::dynamic_pointer_cast<StylusPickResult>(pickResult);
|
||||
if (!stylusPickResult) {
|
||||
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