Skip to content

The grasping function has captured objects outside the range #7

Description

@kong2456878740

Problem description

Hello, recently I encountered some issues while testing the scraping function of this library. In the source code of setGrabAction, it seems that a sphere is created in hand and collided with the model in the scene for detection to determine if the model can be grabbed. During the test, I imported a model in the.j3o format. However, during the testing process, it is still possible to pick up the model from a far distance outside the bounding box range of the model. But this usually only occurs when the object is picked up for the first time after the project runs. But when I perform this operation on the directly created box, this problem does not occur. I hope to get your clarification.
Image
Image

Operating Environment

tamarin 3.0.1
jdk 22

Code

public class VRTest extends BaseApp {
    public static void main(String[] args) {
        AppSettings settings = new AppSettings(true);
        //settings.setSamples(4);
        //settings.setResolution(1280,960);
        settings.setWindowSize(1280, 720);
        settings.put("Renderer", AppSettings.LWJGL_OPENGL45);
        settings.setTitle("Tamarin OpenXR Example");
        settings.setVSync(false);
        VRTest app = new VRTest();
        app.setLostFocusBehavior(LostFocusBehavior.Disabled);
        app.setSettings(settings);
        app.setShowSettings(false);
        app.start();
    }

 @Override
    public void simpleInitApp(){
        Spatial shell = assetManager.loadModel("shell.j3o");
        sceneNode = new Node("sceneNode");
        sceneNode.attachChild(shell);
        RelativeMovingGrabControl grabControl = new RelativeMovingGrabControl();
        shell.addControl(grabControl);
        rootNode.attachChild(sceneNode);
    }

 @Override
    public void simpleUpdate(float tpf) {
        if (!grabActionBound) {
            if (!vrHandsAppState.getHandControls().isEmpty()) {
                vrHandsAppState.getHandControls().forEach(boundHand ->
                        boundHand.setGrabAction(ActionHandles.GRIP, rootNode));
                grabActionBound = true;
            }
        }
    }
}

Attachment

shell.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions