brndx Posted April 24, 2017 Share Posted April 24, 2017 Almost all of the door models are not detected when performing a raycast unless they are the sliding doors included with Leadwerks. This occurs despite the same script operating on each door and every material having pick mode enabled. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
cassius Posted April 24, 2017 Share Posted April 24, 2017 Can you use getdistance instead of a raycast? amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Rick Posted April 24, 2017 Share Posted April 24, 2017 What is the collision type set to for those doors in the physics tab? Link to comment Share on other sites More sharing options...
brndx Posted April 24, 2017 Author Share Posted April 24, 2017 The collision type is prop and getting the distance will not do as the problem is with the camera passing through the door rather than interaction. The raycast works fine here as the info box and interaction are working: and here the camera passes through the door when it doesn't for the models included with leadwerks: Link to comment Share on other sites More sharing options...
Rick Posted April 24, 2017 Share Posted April 24, 2017 Can you show us your picking code? Link to comment Share on other sites More sharing options...
brndx Posted April 25, 2017 Author Share Posted April 25, 2017 if self.target==nil then return end if hoverplayer ~= 1 then self.distance = 0.8 self.pickradius = 0.2 local originalcamerapos = self.entity:GetPosition(true) local targetpos = self.target:GetPosition(true) local newcamerapos = self.target:GetPosition(true) targetpos.y = targetpos.y+camheight self.entity:SetPosition(targetpos) self.entity:Move(0.4,0,-self.distance) local targetpickmode = self.target:GetPickMode() jill.script.target:SetPickMode(0) newcamerapos = self.entity:GetPosition() local pickinfo = PickInfo() if (self.entity.world:Pick(Vec3(targetpos.x+0.1,targetpos.y,targetpos.z),self.entity:GetPosition(),pickinfo,self.pickradius,true)) then if pickinfo.entity:GetCollisionType() ~= 4 and pickinfo.entity:GetCollisionType() ~= 0 then newcamerapos = pickinfo.position jill.script.target:Hide() newcamerapos.x = Math:Curve(originalcamerapos.x,newcamerapos.x,100/Time:GetSpeed()) newcamerapos.y = Math:Curve(originalcamerapos.y,newcamerapos.y,100/Time:GetSpeed()) newcamerapos.z = Math:Curve(originalcamerapos.z,newcamerapos.z,100/Time:GetSpeed()) self.entity:SetPosition(newcamerapos) else jill.script.target:Show() end jill.script.target:SetPickMode(targetpickmode) end end Link to comment Share on other sites More sharing options...
Josh Posted April 25, 2017 Share Posted April 25, 2017 What is the scale of the door models? My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
brndx Posted April 25, 2017 Author Share Posted April 25, 2017 The scale is (0.014,0.014,0.017). Perhaps changing it to 1.0 will solve the problem. Link to comment Share on other sites More sharing options...
brndx Posted April 25, 2017 Author Share Posted April 25, 2017 Altering the scale to 1.0 seems to have worked. 1 Link to comment Share on other sites More sharing options...
Josh Posted April 25, 2017 Share Posted April 25, 2017 I think the radius of the pick is effected by scale, perhaps, or there may be a box test that isn't accounting for the scale. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted February 28, 2019 Share Posted February 28, 2019 Need model to test! My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts