/* Copyright 2003-2005 ROBLOX Corporation, All Rights Reserved */ #include "stdafx.h" #include "Util/HitTest.h" #include "Util/Math.h" #include "Util/Extents.h" #include "AppDraw/DrawAdorn.h" #include "AppDraw/HitTest.h" #include "G3D/CollisionDetection.h" #include "G3D/Capsule.h" #include "v8datamodel/FastLogSettings.h" namespace RBX { bool HandleHitTest::hitTestHandleWorld( const Extents& worldExtents, HandleType handleType, const RbxRay& gridRay, Vector3& hitPointWorld, NormalId& worldNormalId, const int normalIdMask) { CoordinateFrame location(worldExtents.center()); Extents localExtents = Extents::fromCenterCorner(Vector3::zero(), worldExtents.size() * 0.5); return hitTestHandleLocal( localExtents, location, handleType, gridRay, hitPointWorld, worldNormalId, normalIdMask); } bool HandleHitTest::hitTestHandleLocal( const Extents& localExtents, const CoordinateFrame& location, HandleType handleType, const RbxRay& gridRay, Vector3& hitPointWorld, NormalId& localNormalId, const int normalIdMask) { for (int i = 0; i < 6; ++i) { if(normalIdMask & (1<