Method, host and storage medium for providing input event to virtual object
By establishing a mapping relationship between input events and virtual object coordinates in virtual reality or augmented reality environments, the host can simplify user interaction, solve the problem that users need to perform a large number of targeting operations in virtual environments, and improve user experience.
Patent Information
- Application Number
- CN202411136171.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-12-15
- Filing Date
- 2024-08-19
- Publication Date
- 2025-06-17
AI Technical Summary
In virtual reality or augmented reality environments, users need to perform a lot of targeting operations to interact with applications in the virtual world, which can lead to user fatigue and inconvenience.
By displaying the virtual object in the host and establishing a mapping relationship between the control event of the input object and the coordinates on the virtual object, the host can receive the control event from the input object, and determine the target coordinates based on the mapping relationship, providing the corresponding input event to the virtual object.
This method simplifies user interaction with virtual objects, reduces targeting operations that need to be performed, thereby improving user experience and interaction efficiency.
Smart Images

Figure CN120154890A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a mechanism for providing reality services, and more particularly to a method, a host, and a storage medium for providing input events to virtual objects. Background Art
[0002] In order to enable users to use existing applications on virtual reality (VR) or augmented reality (AR) devices, the interfaces of existing 2D applications or other streaming media sources (such as PCs or smartphones) provide a virtual environment (such as a VR world) in the form of a 2D panel (such as a 2D window). However, the related operations are not as intuitive and convenient as the original use on mobile devices or PCs.
[0003] Figure 1 Shows a traditional way of interacting with a 2D window in a virtual environment. In Figure 1 , the user 19 can wear a head-mounted display (HMD) 10 to experience the reality service provided by the HMD 10.
[0004] In Figure 1 's exemplary scenario, the HMD 10 can be assumed to provide VR services. In this case, the HMD 10 can render the corresponding virtual world 11 (such as a VR world) for the user 19 to view.
[0005] When the HMD 10 is connected to other electronic devices (such as a computer and / or a smart device), the HMD 10 can display a 2D window 12 in the virtual world 11, where the 2D window 12 can mirror the screen of the considered electronic device.
[0006] In Figure 1 , it is assumed that the 2D window 12 displays an application currently running on the electronic device (such as an android game application), where the application can be designed with some control areas 12a (such as a virtual joystick) and / or 12b (such as a virtual button), and the user 19 can use the handheld controllers 13a and 13b (such as VR controllers) to interact with this application through the virtual world 11.
[0007] Specifically, the HMD 10 can display rays 14a and 14b corresponding to the handheld controllers 13a and 13b respectively, and the user 19 can use the rays 14a and 14b to interact with the application.
[0008] For example, if user 19 wants to trigger control area 12b, user 19 can aim at control area 12b using ray 14b by moving handheld controller 13b, and user 19 can, for example, press a physical button on handheld controller 13b. In this case, HMD 10 can determine the position indicated / pointed to by ray 14b in virtual world 11, and accordingly determine the corresponding 2D coordinates on the application based on, for example, the dimensions / resolution associated with 2D window 12. Thereafter, HMD 10 can determine the input event that has occurred at the determined 2D coordinates, and HMD 10 can provide this input event to the application for the application to react in response to the input of user 19.
[0009] Similarly, user 19 can control control area 12a by performing some dragging operations using ray 12a, and the associated input event will also be provided to the application for the application to react.
[0010] In some cases, the application can also run on HMD 10 itself, and HMD 10 can still display the same content as Figure 1 shown, enabling user 19 to interact with the application in the manner discussed above. Figure 1 However, in the
[0011] scenario, user 19 needs to perform a large amount of aiming, such that user 19 may feel tired and inconvenient when interacting with virtual world 11. Figure 1 Summary of the Invention In view of this, the present invention provides a method, host, and storage medium for providing an input event to a virtual object, which can be used to solve the above technical problems.
[0012] Embodiments of the present invention provide a method for providing an input event to a virtual object, which is applied to a host. This method includes: the host displaying a first virtual object in a virtual world, where the first virtual object includes multiple coordinates; the host obtaining at least one mapping relationship between a control event of an input object and the multiple coordinates on the first virtual object; the host receiving a control event from the input object; the host determining a first target coordinate corresponding to the control event among the multiple coordinates based on the at least one mapping relationship, and providing a first input event to the first virtual object based on the first target coordinate, where the first input event corresponds to the control event from the input object.
[0013]
[0014] An embodiment of the present invention provides a host, including a storage circuit and a processor. The storage circuit stores program code. The processor is coupled to the storage circuit and accesses the program code to execute: displaying a first virtual object in a virtual world, where the first virtual object includes a plurality of coordinates; obtaining at least one mapping relationship between a control event of an input object and the plurality of coordinates on the first virtual object; receiving a control event from the input object; determining a first target coordinate corresponding to the control event among the plurality of coordinates based on the at least one mapping relationship, and providing a first input event to the first virtual object based on the first target coordinate, where the first input event corresponds to the control event from the input object.
[0015] An embodiment of the present invention provides a computer-readable storage medium, which records an executable computer program. The executable computer program is loaded by a host to execute the following steps: displaying a first virtual object in a virtual world, where the first virtual object includes a plurality of coordinates; obtaining at least one mapping relationship between a control event of an input object and the plurality of coordinates on the first virtual object; receiving a control event from the input object; determining a first target coordinate corresponding to the control event among the plurality of coordinates based on the at least one mapping relationship, and providing a first input event to the first virtual object based on the first target coordinate, where the first input event corresponds to the control event from the input object. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are included to provide a further understanding of the present invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the present invention and, together with the description, are used to explain the principles of the present invention.
[0017] Figure 1 Shows a traditional way of interacting with a 2D window in a virtual environment.
[0018] Figure 2 Is a schematic diagram of a host illustrated according to an embodiment of the present invention.
[0019] Figure 3 Is a flowchart of a method for providing an input event to a virtual object illustrated according to an embodiment of the present invention.
[0020] Figure 4 Is a schematic diagram of an application scenario illustrated according to an embodiment of the present invention.
[0021] Figure 5A Is an application scenario illustrated according to the first embodiment of the present invention.
[0022] Figure 5B Is another application scenario illustrated according to the first embodiment of the present invention.
[0023] Figure 6 Is an application scenario illustrated according to the second embodiment of the present invention.
[0024] Figure 7 is a flowchart of a method for providing an input event to a virtual object according to an embodiment of the present invention.
[0025] Figure 8 is a schematic diagram of an application scenario according to an embodiment of the present invention. Detailed Description of the Invention
[0026] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numerals will be used throughout the drawings and the description to refer to the same or like parts.
[0027] Please refer to Figure 2 , Figure 2 is a schematic diagram of a host according to an embodiment of the present invention. In various embodiments, the host 200 may be any intelligent device and / or computer device capable of providing visual content of a reality service such as virtual reality (VR) service, augmented reality (AR) service, mixed reality (MR) service, or extended reality (XR) service, but the present invention is not limited thereto. In some embodiments, the host 200 may be a head-mounted display (HMD) capable of displaying / providing visual content (e.g., MR / XR / AR / VR content) for a wearer / user to view. For a better understanding of the concept of the present invention, the host 200 will be assumed to be a VR device (e.g., a VR HMD such as the HMD 10) for providing VR content for a user to view, but the present invention is not limited thereto.
[0028] In one embodiment, the host 200 may have a built-in display for displaying VR content for a user to view. Additionally or alternatively, the host 200 may be connected to one or more external displays, and the host 200 may transmit VR content to the external displays for the external displays to display the VR content, but the present invention is not limited thereto.
[0029] In some embodiments, the host 200 may be provided with some tracking engines for tracking one or more trackable objects, such as a handheld controller (e.g., a VR controller), a wearable device, a gesture, and / or any other tracker, but the present invention is not limited thereto.
[0030] In some embodiments, the host 200 may be designed to track trackable objects by using, for example, an inside-out and / or an outside-in tracking mechanism, such as simultaneous localization and mapping (SLAM) and / or Lighthouse, but the present invention is not limited thereto.
[0031] In Figure 2In this case, the host 200 includes a storage circuit 202 and a processor 204. The storage circuit 202 is one or a combination of a fixed or mobile random access memory (RAM), a read-only memory (ROM), a flash memory, a hard disk, or any other similar device, and records a plurality of modules and / or program codes that can be executed by the processor 204.
[0032] The processor 204 can be coupled to the storage circuit 202, and the processor 204 can be, for example, a general-purpose processor, a dedicated processor, a conventional processor, a digital signal processor (DSP), a plurality of microprocessors, one or more microprocessors associated with a DSP core, a controller, a microcontroller, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) circuit, any other type of integrated circuit (IC), a state machine, etc.
[0033] In an embodiment of the present invention, the processor 204 can access the modules and / or program codes stored in the storage circuit 202 to implement the method for providing an input event to a virtual object provided by the present invention, which will be further discussed below.
[0034] Please refer to Figure 3 , Figure 3 is a flowchart of a method for providing an input event to a virtual object illustrated according to an embodiment of the present invention. The method of this embodiment can be executed by the host 200 of Figure 2 , and the details of each step will be supplemented with the components of Figure 2 below. In addition, for ease of understanding, Figure 3 will be used as an illustrative example, where Figure 4 is a schematic diagram of an application scenario illustrated according to an embodiment of the present invention. Figure 4
[0035] In step S310, the processor 204 displays a first virtual object 41 in the virtual world 40. In this embodiment, the virtual world 40 can be a 3D virtual environment of a real service provided by the host 200, such as a VR world, but the present invention is not limited thereto. In various embodiments, the first virtual object 41 can be a 2D window, and the 2D window can be used to display some 2D content.
[0036] In one embodiment, the host 200 can be used to run an application program corresponding to a mobile operating system (for example, an android / iOS application program), and can display associated content in the 2D window. For example, if the host 200 is used to execute an Android application program, the associated visual content (for example, 2D visual content) of the Android application program can be additionally displayed in the 2D window, but the present invention is not limited thereto.
[0037] In one embodiment, the host 200 may be connected to an electronic device (e.g., an external computer and / or a smart device), and this electronic device may be used to run the above-mentioned application (e.g., an Android application).
[0038] In this case, the processor 204 may receive a screen stream from the electronic device running the application and render 2D visual content based on the screen stream. Then, the processor 204 may display the rendered 2D visual content within a 2D window.
[0039] In an embodiment of the present invention, the 2D window and the 2D visual content displayed therein may be regarded as different virtual objects, but the present invention is not limited thereto.
[0040] In one embodiment, the first virtual object 41 includes a plurality of coordinates. In one embodiment, the plurality of coordinates of the first virtual object 41 may include a plurality of 2D coordinates within the 2D window.
[0041] For example, if the resolution of the 2D window in the virtual world 40 is WxH, it may be assumed that there are WxH 2D coordinates in the 2D window, and the 3D coordinates corresponding to these 2D coordinates in the virtual world 40 can be derived based on the position / height / width of the 2D window in the virtual world 40.
[0042] In step S320, the processor 204 obtains at least one mapping relationship between the control event of the input object and the plurality of coordinates on the first virtual object 41.
[0043] In various embodiments, the input object to be considered may be an object used by the user to perform an input operation on the host 200, such as a handheld controller and / or the user's hand, but the present invention is not limited thereto.
[0044] In the first embodiment, the input object may be a handheld controller 421 having a physical button 421a, and the mapping relationship may include a first mapping relationship between the control event corresponding to the physical button 421a and the first coordinate 411 among the plurality of coordinates.
[0045] In the second embodiment, the input object may be a handheld controller 422 having a joystick 422a, and the joystick 422a has a default position on the handheld controller 422, and the above mapping relationship may include a second mapping relationship between the control event corresponding to the default position of the joystick 422a and the second coordinate 412 among the plurality of coordinates.
[0046] In the third embodiment, the input object may be the hand 423 of the user of the host 200, and the mapping relationship may include a third mapping relationship between a control event corresponding to a first gesture (e.g., a pinch gesture, a pinch-and-hold gesture, a fist gesture, an open-palm gesture) and a third coordinate among the plurality of coordinates.
[0047] In some embodiments where a first virtual object 41 (e.g., a 2D window) is used to display an application program (e.g., Figure 1 the application program exemplarily shown herein), since the application program may be designed with some controllable objects (e.g., virtual joysticks / buttons), a mapping relationship between the control event of the input object and the plurality of coordinates on the first virtual object 41 can be determined accordingly.
[0048] For example, in the first embodiment, it may be assumed that when the application program is displayed within the 2D window, there is a first controllable object (e.g., a virtual button) at the first coordinate 411. Based on this, if the physical button 421a is designed / assigned to trigger the first controllable object, the first mapping relationship can be established accordingly.
[0049] Again, for example, it may be assumed that in the second embodiment, when the application program is displayed within the 2D window, there is a second controllable object (e.g., a virtual joystick) at the second coordinate 412. Based on this, if the joystick 422a is designed / assigned to control the second controllable object, the second mapping relationship can be established accordingly.
[0050] Again, for example, it may be assumed that in the third embodiment, when the application program is displayed within the 2D window, there will be a third controllable object (e.g., a virtual button) at the third coordinate 413. Based on this, if the first gesture is designed / assigned to trigger the third controllable object, the third mapping relationship can be established accordingly, but the present invention is not limited thereto. In Figure 4 this case, the third coordinate 413 may be the same as the first coordinate 411, and the third controllable object may be the same as the first controllable object, which allows the user to trigger the same controllable object by using the handheld controller 421 and / or the hand.
[0051] In other embodiments, the third coordinate 413 may be different from the first coordinate 411, and the third controllable object may be the same as or different from the first controllable object, but the present invention is not limited thereto.
[0052] In the embodiments of the present invention, during the process of establishing the mapping relationship, the processor 204 may require the user to generate a control event (e.g., button, gesture, moving the joystick, etc.) using the input object and select the coordinate to be mapped to the control event. In this case, the processor 204 can establish a mapping relationship between the generated control event and the associated coordinate accordingly.
[0053] For example, when establishing the first mapping relationship, the user can press the physical button 421a to generate an associated control event, and select the first coordinate 411 by, for example, using a ray to point to the first coordinate 411. In this case, the processor 204 can establish the first mapping relationship between the control event corresponding to the physical button 421a and the first coordinate 411 accordingly.
[0054] Also, for example, when establishing the third mapping relationship, the user can make a first gesture to generate a related control event, and select the third coordinate by, for example, using a ray to point to the third coordinate. At this time, the processor 204 can establish the third mapping relationship between the control event corresponding to the first gesture and the third coordinate accordingly.
[0055] In step S330, the processor 204 receives a control event from the input object. In an embodiment where the input object is assumed to be a handheld controller, the handheld controller can, for example, send a control event when a certain physical button on it is triggered (e.g., pressed, held down, etc.). In this case, the control event can indicate that a certain physical button has been triggered.
[0056] In addition, the handheld controller can, for example, also send a control event when the joystick on it is pushed in a certain direction. In this case, the control event can indicate that the joystick has been pushed in that direction.
[0057] In some embodiments, since the handheld controller can detect its posture / movement, the handheld controller can also provide the detected posture / movement in the control event. For example, if the handheld controller determines that its body has moved in the first direction while holding down a certain physical button, the handheld controller can provide a corresponding control event to the host 200 to indicate this situation, but the present invention is not limited thereto.
[0058] In an embodiment where the input object is assumed to be a hand, when the processor 204 determines, for example, that the hand has performed some specific gestures (e.g., the first gesture), the processor 204 can determine that a control event has been received from the input object, but the present invention is not limited thereto. In some embodiments, one or more specific gestures can be designed to represent some operations corresponding to the operations that may be performed on the handheld controller, such as pressing a button, clicking a button, pushing a joystick in a certain direction, etc.
[0059] In some embodiments, since the host 200 can detect the posture / movement of the user's hand, when the processor 204 determines that the hand is moving in a certain direction while maintaining a certain specific gesture, the processor 204 can determine that a control event has been received from the input object.
[0060] In step S340, the processor 204 determines a first target coordinate corresponding to the control event among the multiple coordinates based on at least one mapping relationship, and provides a first input event to the first virtual object 41 based on the first target coordinate. In an embodiment of the present invention, the first input event corresponds to a control event from an input object. Alternatively or additionally, the first input event can be used to control a controllable object associated with the first target coordinate, but the present invention is not limited thereto.
[0061] Please refer to Figure 5A , Figure 5A FIG. is an application scenario illustrated according to the first embodiment of the present invention. In the first embodiment, in response to determining that the control event indicates that the physical button 421a is triggered, the processor 204 determines the first coordinate 411 as the first target coordinate, and provides a first input event to the first virtual object 41 accordingly, where the first input event is a trigger event at the first coordinate 411.
[0062] In the first embodiment, if the application receives a control event when it is displayed in a 2D window (where the first controllable object 511 is displayed at a position corresponding to the first coordinate 411), the first input event (e.g., a trigger event at the first coordinate 411) can be used accordingly to trigger the first controllable object 511 (e.g., a virtual button) in the application, such that the application will react in response to the first input event.
[0063] Please refer to Figure 5B , Figure 5B FIG. is another application scenario illustrated according to the first embodiment of the present invention. In Figure 5B it can be further assumed that the physical button 421b on the handheld controller 421 is designed to have a corresponding mapping relationship with the coordinate 411a, where when the application is displayed in a 2D window, the controllable object 511a (e.g., a virtual joystick) can be displayed at the coordinate 411a.
[0064] In this case, in response to determining that the control event (referred to as a specific control event) indicates that while the physical button 421b is pressed and held, the body of the handheld controller 421 has moved in a first direction D1, the processor 204 determines the coordinate 411a as the first target coordinate, and provides a first input event to the first virtual object 41 accordingly, where the first input event is a drag event starting from the coordinate 411a, and the drag direction of this drag event corresponds to the first direction D1.
[0065] In Figure 5BIn this case, if the application receives a specific control event when being displayed within the 2D window (i.e., a controllable object 511a displayed at a position corresponding to the coordinate 411a), the first input event (e.g., a drag event starting from the coordinate 411a) can be correspondingly used to drag the controllable object 511a (e.g., a virtual joystick) in the application, such that the application will react in response to the first input event.
[0066] In addition, in response to determining that the drag event ends at a second target coordinate corresponding to a specific function, the processor 204 can accordingly provide a second input event to the first virtual object 41, wherein the second input event triggers the specific function.
[0067] For example, the controllable object 511a can be designed to have a specific function (e.g., a cancel function indicated by the icon 513) when being dragged in the first direction D1. In this case, the processor 204 can determine whether the drag event ends at the second target coordinate corresponding to the specific function.
[0068] In one embodiment, the processor 204 can determine whether the physical button 421b is released during the process that the controllable object 511a is substantially dragged in the first direction D1 and / or towards the icon 513. If so, the processor 204 can determine that the drag event has ended, and determine that the coordinate where the physical button 421b is released is the second target coordinate corresponding to the specific function. Then, the processor 204 can provide a corresponding second input event to the first virtual object 41, wherein the second input event triggers the specific function (e.g., the cancel function indicated by the icon 513), but the present invention is not limited thereto.
[0069] Please refer to Figure 6 , Figure 6 which is an application scenario illustrated according to the second embodiment of the present invention. In the second embodiment, in response to determining that the joystick 422a has been pushed in the second direction D2, the processor 204 determines that the second coordinate 412 is the first target coordinate, and accordingly provides a first input event to the first virtual object 41, wherein the first input event is a drag event starting from the second coordinate 412, and the drag direction of the drag event corresponds to the second direction D2.
[0070] In the second embodiment, if the application receives a control event when being displayed within the 2D window (wherein a second controllable object 611 is displayed at a position corresponding to the second coordinate 412), the first input event (e.g., a drag event starting from the second coordinate 412) can be correspondingly used to control (e.g., drag) the second controllable object 611 (e.g., a virtual joystick) in the application, such that the application will react in response to the first input event.
[0071] In a third embodiment where the input object is assumed to be the hand 423 of the user, Figure 5A 、 Figure 5B and Figure 6 the operations discussed therein can be implemented in a similar manner.
[0072] In one embodiment, in response to determining that a control event indicates that the hand 423 has changed to a first gesture (e.g., a fist gesture), the processor 204 may determine the third coordinate 413 as a first target coordinate and, accordingly, provide a first input event to the first virtual object 41, where the first input event is a trigger event at the third coordinate 413.
[0073] In the Figure 4 、 Figure 5A illustrated scenario, since the third coordinate 413 is assumed to be the same as the first coordinate 411, the first input event (e.g., a trigger event at the third coordinate 413) can accordingly be used to trigger a first controllable object 511 (e.g., a virtual button) in the application, such that the application can react to the first input event.
[0074] In one embodiment, in response to determining that a control event indicates that the hand 423 has maintained the first gesture while moving in a first direction D1, the processor 204 may determine the third coordinate 413 as a first target coordinate and, accordingly, provide a first input event to the first virtual object 41, where the first input event is a drag event starting from the third coordinate 413, and the drag direction of the drag event corresponds to the first direction D1.
[0075] For ease of understanding, it can be assumed that the considered third coordinate 413 is the same as the Figure 5B coordinate 411a. In this case, the processor 204 determines the third coordinate 413 as the first target coordinate and, accordingly, provides a first input event to the first virtual object 41, where the first input event is a drag event starting from the Figure 5B third coordinate 413 therein, and the drag direction of the drag event corresponds to the first direction D1.
[0076] In this case, the first input event (e.g., a drag event starting from the third coordinate 413) can accordingly be used to drag a controllable object 511a (e.g., a virtual joystick) in the application, such that the application will react in response to the first input event.
[0077] Additionally, in response to determining that the drag event ends at a second target coordinate corresponding to a specific function, the processor 204 may, accordingly, provide a second input event to the first virtual object 41, where the second input event triggers the specific function.
[0078] For example, the controllable object 511a can be designed to have a specific function (e.g., the cancel function indicated by the icon 513) when dragged in the first direction D1. In this case, the processor 204 can determine whether the drag event ends at the second target coordinates corresponding to the specific function.
[0079] In one embodiment, the processor 204 can determine whether the hand 423 changes from the first gesture to another gesture while the controllable object 511a is being substantially dragged in the first direction D1 and / or towards the icon 513. If so, the processor 204 can determine that the drag event has ended and determine the coordinates of the gesture change as the second target coordinates corresponding to the specific function. Then, the processor 204 can provide a corresponding second input event to the first virtual object 41, where the second input event triggers the specific function (e.g., the cancel function indicated by the icon 513), but the present invention is not limited thereto.
[0080] Please refer to Figure 7 , Figure 7 is a flowchart of a method for providing an input event to a virtual object according to an embodiment of the present invention. The method of this embodiment can be executed by the host 200 of Figure 2 , and the following will be supplemented with the component description of Figure 2 for the details of each step. In addition, for ease of understanding, Figure 7 will be used as an illustrative example, where Figure 8 is a schematic diagram of an application scenario according to an embodiment of the present invention. Figure 8 is a schematic diagram of an application scenario according to an embodiment of the present invention.
[0081] In Figure 7 , the processor 204 can execute Figure 3 steps S310 to S330, and the relevant details can be referred to the previous description.
[0082] In this embodiment, the processor 204 can further execute step S710 to display a second virtual object 82 in the virtual world 40, where the second virtual object 82 provides a management function associated with the first virtual object 41.
[0083] In Figure 8 , the management function provided by the second virtual object 82 can be to cancel the first virtual object 41, but the present invention is not limited thereto.
[0084] In step S720, the processor 204 displays an index 81 corresponding to the input object. In Figure 8 , it can be assumed that the input object is the handheld controller 421, and the corresponding index 81 can be, for example, a ray corresponding to the handheld controller 421, but the present invention is not limited thereto.
[0085] In step S730, the processor 204 determines whether a control event is received when the indicator 81 does not indicate the second virtual object 82.
[0086] In one embodiment, in response to determining that a control event is received in a first case where the indicator 81 does not indicate the second virtual object 82 (e.g., does not point to the second virtual object 82), the processor 204 may accordingly execute step S340, and the relevant details may be referred to the previous description.
[0087] On the other hand, in response to determining that a control event is received in a second case where the indicator 81 is indicating the second virtual object 82 (e.g., pointing to the second virtual object 82), the processor 204 may execute step S740 to perform a management function associated with the first virtual object 41 without providing any input event to the first virtual object 41. For example, if a control event is received when the indicator 81 points to the second virtual object 82, the processor 204 may directly cancel the first virtual object 41 by, for example, closing the 2D window, but the present invention is not limited thereto.
[0088] The present invention also provides a computer-readable storage medium for executing a method of providing an input event to a virtual object. The computer-readable storage medium consists of a plurality of program instructions (e.g., setting program instructions and deployment program instructions) contained therein. These program instructions can be loaded into the host 200 and executed by the host 200 to execute the above method of providing an input event to a virtual object and the functions of the host 200.
[0089] In summary, the embodiments of the present invention provide a more convenient solution for users to interact with virtual objects (e.g., 2D windows), thereby improving the user experience.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or equivalently replace some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for providing input events to a virtual object, applied to a host, characterized in that: include: Displaying, by the host, a first virtual object in a virtual world, wherein the first virtual object includes a plurality of coordinates; The host obtains at least one mapping relationship between a control event of an input object and the plurality of coordinates on the first virtual object; Receiving, by the host, a control event from the input object; The host determines a first target coordinate among the multiple coordinates corresponding to the control event based on the at least one mapping relationship, and provides a first input event to the first virtual object based on the first target coordinate, wherein the first input event corresponds to the control event from the input object.
2. The method according to claim 1, wherein the input object comprises a handheld controller having a physical button, and the at least one mapping relationship comprises a first mapping relationship between the physical button and a first coordinate of the plurality of coordinates, and the method comprises: In response to determining that the control event indicates that the physical button has been triggered, determining that the first coordinate is the first target coordinate, and providing the first input event to the first virtual object accordingly, wherein the first input event is a trigger event at the first coordinate.
3. The method according to claim 1, wherein the input object comprises a handheld controller having the physical button, and the at least one mapping relationship comprises a first mapping relationship between the physical button and the first coordinates between the plurality of physical buttons, and the method comprises: In response to determining that the control event indicates that the body of the handheld controller has moved in a first direction while the physical button is pressed and held, the first coordinate is determined as the first target coordinate, and the first input event is provided to the first virtual object accordingly, wherein the first input event is a drag event starting from the first coordinate, and the dragging direction of the drag event corresponds to the first direction.
4. The method according to claim 3, further comprising: In response to determining that the drag event ends at a second target coordinate corresponding to a function, a second input event is provided to the first virtual object, wherein the second input event triggers the function.
5. The method of claim 1 , wherein the input object comprises a handheld controller having a joystick, the joystick having a default position on the handheld controller, and the at least one mapping relationship comprises a second mapping relationship between the default position of the joystick and a second coordinate of the plurality of coordinates, and the method comprises: In response to determining that the control event indicates that the joystick has been pushed in a second direction, the second coordinate is determined to be the first target coordinate, and a first input event is provided to the first virtual object accordingly, wherein the first input event is a drag event starting from the second coordinate, and the drag direction of the drag event corresponds to the second direction.
6. The method according to claim 1, wherein the input object comprises a hand, and the at least one mapping relationship comprises a third mapping relationship between the first gesture and a third coordinate of the plurality of coordinates, and the method comprises: In response to determining that the control event indicates that the hand has changed to the first gesture, the third coordinate is determined to be the first target coordinate, and a first input event is provided to the first virtual object accordingly, wherein the first input event is a trigger event on the third coordinate.
7. The method according to claim 1, wherein the input object comprises a hand, and the at least one mapping relationship comprises a third mapping relationship between the first gesture and a third coordinate of the plurality of coordinates, and the method comprises: In response to determining that the control event indicates that the hand is moved in a first direction while maintaining the first gesture, the third coordinate is determined as the first target coordinate, and the first input event is provided to the first virtual object accordingly, wherein the first input event is a drag event starting from the third coordinate, and the dragging direction of the drag event corresponds to the first direction.
8. The method according to claim 7, further comprising: In response to determining that the drag event ends at a second target coordinate corresponding to a function, a second input event is provided to the first virtual object, wherein the second input event triggers the function.
9. The method according to claim 1, further comprising: displaying a second virtual object in the virtual world, wherein the second virtual object provides a management function associated with the first virtual object; displaying an indicator corresponding to the input object; In response to determining that the control event is received in the first case where the indicator does not indicate the second virtual object, the first target coordinates corresponding to the control event are determined based on the at least one mapping relationship, and the first input event is provided to the first virtual object based on the first target coordinates.
10. The method according to claim 9, further comprising: In response to determining that the control event is received in the second instance where the indicator indicates the second virtual object, the management function associated with the first virtual object is performed without providing any input event to the first virtual object.
11. The method of claim 1, wherein the virtual world is a 3D virtual environment of a reality service provided by the host. The method of claim 1 , wherein the first virtual object is a 2D window.
13. The method according to claim 12, further comprising: Receiving a screen stream from an electronic device running an application, and rendering 2D visual content according to the screen stream; as well as The 2D visual content is displayed in the 2D window. The method of claim 12 , wherein the plurality of coordinates of the first virtual object comprises a plurality of 2D coordinates within the 2D window.
15. The method according to claim 14, wherein the 2D window shows an application including at least one controllable object, and the at least one mapping relationship between the input object and the multiple coordinates on the first virtual object is determined based on the 2D position of each of the controllable objects in the 2D window.
16. A host, characterized in that: include: A storage circuit for storing program codes; as well as A processor, coupled to the storage circuit and accessing the program code to execute: Displaying a first virtual object in a virtual world, wherein the first virtual object includes a plurality of coordinates; Obtain at least one mapping relationship between a control event of an input object and the plurality of coordinates on the first virtual object receiving a control event from the input object; A first target coordinate corresponding to the control event among the multiple coordinates is determined based on the at least one mapping relationship, and a first input event is provided to the first virtual object based on the first target coordinate, wherein the first input event corresponds to the control event from the input object.
17. The host of claim 16, wherein the input object comprises a handheld controller having a physical button, and the at least one mapping relationship comprises a first mapping relationship between the physical button and a first coordinate of the plurality of coordinates, and the processor is configured to perform: In response to determining that the control event indicates that the physical button has been triggered, determining that the first coordinate is the first target coordinate, and providing the first input event to the first virtual object accordingly, wherein the first input event is a trigger event at the first coordinate.
18. The host of claim 16, wherein the input object comprises a handheld controller having a physical button, and the at least one mapping relationship comprises a first mapping relationship between the physical button and a first coordinate between the plurality of first coordinates, and the processor is configured to perform: In response to determining that the control event indicates that the body of the handheld controller has moved toward a first direction while the physical button is pressed and held, determining the first coordinate as the first target coordinate, and providing the first input event to the first virtual object accordingly, wherein the first input event is a drag event starting from the first coordinate, and the dragging direction of the drag event corresponds to the first direction; and In response to determining that the drag event ends at a second target coordinate among the plurality of coordinates, a second input event is provided to the first virtual object, wherein the second input event is a trigger event at the second coordinate.
19. The host of claim 16, wherein the input object comprises a handheld controller having a joystick, the joystick having a default position on the handheld controller, and the at least one mapping relationship comprises a second mapping relationship between the default position of the joystick and a second coordinate in the plurality of coordinates, and the processor is configured to perform: In response to determining that the control event indicates that the joystick has been pushed in a second direction, the second coordinate is determined to be the first target coordinate, and a first input event is provided to the first virtual object accordingly, wherein the first input event is a drag event starting from the second coordinate, and the drag direction of the drag event corresponds to the second direction.
20. A computer-readable storage medium, characterized in that: The computer readable storage medium records an executable computer program, and the executable computer program is loaded by a host to perform the following steps: Displaying a first virtual object in a virtual world, wherein the first virtual object includes a plurality of coordinates; Obtaining at least one mapping relationship between a control event of an input object and the plurality of coordinates on the first virtual object; receiving a control event from the input object; A first target coordinate corresponding to the control event among the multiple coordinates is determined based on the at least one mapping relationship, and a first input event is provided to the first virtual object based on the first target coordinate, wherein the first input event corresponds to the control event from the input object.