WO2023103615A1 - 虚拟对象的切换方法、装置、设备、介质及程序产品 - Google Patents
虚拟对象的切换方法、装置、设备、介质及程序产品 Download PDFInfo
- Publication number
- WO2023103615A1 WO2023103615A1 PCT/CN2022/127014 CN2022127014W WO2023103615A1 WO 2023103615 A1 WO2023103615 A1 WO 2023103615A1 CN 2022127014 W CN2022127014 W CN 2022127014W WO 2023103615 A1 WO2023103615 A1 WO 2023103615A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- virtual object
- virtual
- acceleration
- swing
- swinging
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 95
- 230000001133 acceleration Effects 0.000 claims description 138
- 230000006399 behavior Effects 0.000 claims description 11
- 238000004590 computer program Methods 0.000 claims description 11
- 230000004044 response Effects 0.000 claims description 11
- 230000000007 visual effect Effects 0.000 claims description 11
- 230000008569 process Effects 0.000 description 18
- 230000000875 corresponding effect Effects 0.000 description 14
- 230000008859 change Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 12
- 230000000694 effects Effects 0.000 description 6
- 230000035772 mutation Effects 0.000 description 6
- 230000002093 peripheral effect Effects 0.000 description 6
- 238000004364 calculation method Methods 0.000 description 5
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000003190 augmentative effect Effects 0.000 description 2
- 230000009191 jumping Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 230000001276 controlling effect Effects 0.000 description 1
- 230000002596 correlated effect Effects 0.000 description 1
- 230000007123 defense Effects 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 210000005155 neural progenitor cell Anatomy 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
Images
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/20—Input arrangements for video game devices
- A63F13/21—Input arrangements for video game devices characterised by their sensors, purposes or types
- A63F13/214—Input arrangements for video game devices characterised by their sensors, purposes or types for locating contacts on a surface, e.g. floor mats or touch pads
- A63F13/2145—Input arrangements for video game devices characterised by their sensors, purposes or types for locating contacts on a surface, e.g. floor mats or touch pads the surface being also a display device, e.g. touch screens
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/25—Output arrangements for video game devices
- A63F13/26—Output arrangements for video game devices having at least one additional display device, e.g. on the game controller or outside a game booth
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/53—Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game
- A63F13/533—Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game for prompting the player, e.g. by displaying a game menu
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/20—Input arrangements for video game devices
- A63F13/21—Input arrangements for video game devices characterised by their sensors, purposes or types
- A63F13/211—Input arrangements for video game devices characterised by their sensors, purposes or types using inertial sensors, e.g. accelerometers or gyroscopes
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/40—Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
- A63F13/42—Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle
- A63F13/426—Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle involving on-screen location information, e.g. screen coordinates of an area at which the player is aiming with a light gun
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/40—Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
- A63F13/42—Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle
- A63F13/428—Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment by mapping the input signals into game commands, e.g. mapping the displacement of a stylus on a touch screen to the steering angle of a virtual vehicle involving motion or position input signals, e.g. signals representing the rotation of an input controller or a player's arm motions sensed by accelerometers or gyroscopes
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/50—Controlling the output signals based on the game progress
- A63F13/53—Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game
- A63F13/537—Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen
- A63F13/5372—Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen for tagging characters, objects or locations in the game scene, e.g. displaying a circle under the character controlled by the player
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/55—Controlling game characters or game objects based on the game progress
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
- A63F2300/30—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by output arrangements for receiving control signals generated by the game device
- A63F2300/308—Details of the user interface
Definitions
- the embodiments of the present application relate to the field of virtual environment technology, and in particular to a virtual object switching method, device, device, medium, and program product.
- the user interface is provided with a lock control.
- the terminal automatically locks the first enemy character from several enemy characters.
- the terminal automatically The switching sequence of the first enemy character is switched to the second enemy character for locking.
- the present application provides a virtual object switching method, device, equipment, medium and program product. Described technical scheme is as follows:
- a method for switching virtual objects is provided, the method is executed by a mobile terminal, and the method includes:
- the locked state indicating that the locked virtual object becomes the behavior target of the master virtual object
- the shaking operation is an operation for shaking the body of the mobile terminal
- the first virtual object in the locked state is switched to the second virtual object.
- a device for switching virtual objects comprising:
- the display module is used to display the first virtual object in the locked state and the second virtual object in the unlocked state, and the locked state indicates that the locked virtual object becomes the behavior target of the master virtual object;
- the receiving module is used for receiving the swinging operation, and the swinging operation is used for the operation of the swinging device;
- the switching module is further configured to switch the first virtual object in the locked state to the second virtual object when the swinging operation matches the second virtual object.
- a computer device includes: a processor and a memory, the memory stores a computer program, the computer program is loaded and executed by the processor to implement the above-mentioned The switching method of the virtual object.
- a computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the above virtual object switching method.
- a computer program product comprising computer instructions stored in a computer readable storage medium.
- the processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the virtual object switching method provided in the above aspects.
- the virtual object in the locked state can be switched through the shaking operation, which avoids switching through multiple touches to lock the control, and facilitates the user to quickly switch the locked target.
- the master avatar controlled by the user is in a fierce battle with the first enemy character
- the user finds that the second enemy character has a short fatal flaw, as long as the master avatar attacks it, the second enemy can be defeated.
- side character the user quickly switches the originally locked virtual character (the first enemy character) to the second enemy character through the swing operation, and launches an attack on it. Therefore, setting the swinging operation to switch the locked target not only enriches the user's operation mode, but also improves the efficiency of the user switching the locked target, thereby improving the strategy of the game.
- Fig. 1 shows a structural block diagram of a computer system provided by an exemplary embodiment of the present application
- FIG. 2 shows a flowchart of a virtual object switching method provided by an exemplary embodiment of the present application
- Fig. 3 shows a schematic diagram of a first virtual object in a locked state and a second virtual object not in a locked state provided by an exemplary embodiment of the present application;
- Fig. 4 shows a schematic diagram of the prompt information of the flicking operation provided by an exemplary embodiment of the present application
- Fig. 5 shows a schematic diagram of the prompt information of the swing direction provided by an exemplary embodiment of the present application
- FIG. 6 shows a flowchart of a virtual object switching method provided by another exemplary embodiment of the present application.
- Fig. 7 shows a schematic diagram of determining the swing direction provided by an exemplary embodiment of the present application.
- FIG. 8 shows a flowchart of a virtual object switching method provided by another exemplary embodiment of the present application.
- FIG. 9 shows a flowchart of a virtual object switching method provided by another exemplary embodiment of the present application.
- FIG. 10 shows a schematic diagram of a virtual object switching process provided by an exemplary embodiment of the present application.
- FIG. 11 shows a flowchart of a virtual object switching method provided by another exemplary embodiment of the present application.
- Fig. 12 shows a structural block diagram of a virtual object switching device provided by an exemplary embodiment of the present application
- Fig. 13 shows a structural block diagram of a computer device provided by an exemplary embodiment of the present application.
- Fig. 1 shows a structural block diagram of a computer system provided by an exemplary embodiment of the present application.
- the computer system 100 includes: a mobile terminal 120 and a server 140 .
- the application program can be any one of three-dimensional map program, horizontal version shooting, horizontal version adventure, horizontal version clearance, horizontal version strategy, virtual reality (Virtual Reality, VR) application, augmented reality (Augmented Reality, AR) program .
- the mobile terminal 120 is the mobile terminal used by the user.
- the user uses the mobile terminal 120 to control the master virtual object located in the three-dimensional virtual environment to carry out activities.
- the activities include but are not limited to: adjusting body posture, walking, running, jumping, riding, driving , aiming, picking up, using throwing props, and attacking other virtual objects.
- the master virtual object is a virtual character, such as a simulated character object or an anime character object.
- the user controls the master virtual character to perform activities through UI controls on the virtual environment screen.
- the mobile terminal 120 is connected to the server 140 through a wireless network or a wired network.
- the server 140 includes at least one of a server, multiple servers, a cloud computing platform, and a virtualization center.
- the server 140 includes a processor 144 and a memory 142.
- the memory 142 further includes a receiving module 1421, a control module 1422, and a sending module 1423.
- the receiving module 1421 is used to receive requests sent by applications, such as attacking enemies; It is used to control the rendering of the virtual environment picture; the sending module 1423 is used to send a response to the application program, such as sending the damage value caused by the attack to the application program.
- the server 140 is used to provide background services for applications supporting the 3D virtual environment.
- the server 140 undertakes the main calculation work, and the mobile terminal 120 undertakes the secondary calculation work; or, the server 140 undertakes the secondary calculation work, and the mobile terminal 120 undertakes the main calculation work.
- the above application programs run on different operating system platforms (Android or IOS).
- the device type of the mobile terminal 140 running the application program is the same or different, and the device type includes: smart phone, smart watch, smart TV, vehicle-mounted mobile terminal, wearable device, tablet computer, e-book reader, At least one of MP3 player, MP4 player, laptop portable computer.
- the following embodiments are described by taking mobile terminals including smart phones as examples.
- the number of the foregoing mobile terminals may be more or less. For example, there may be only one mobile terminal, or there may be dozens or hundreds of mobile terminals, or more.
- the embodiment of the present application does not limit the number of mobile terminals and device types.
- FIG. 2 shows a flow chart of a virtual object switching method provided by an exemplary embodiment of the present application, and this method is applied to the mobile terminal 120 shown in FIG. 1 (or on the mobile terminal 120 application) as an example, the method includes:
- Step 220 displaying the first virtual object in the locked state and the second virtual object in the unlocked state
- Locked state indicates that the locked dummy is targeted for actions by the master dummy.
- the locked virtual object may then be attacked by the master virtual object, such as the master virtual object slashes at the locked virtual object, fires, releases projectiles, releases attack skills, etc.
- the master virtual object may move towards the locked virtual object, with the location of the locked virtual object serving as the master virtual object's destination.
- the master control virtual object obtains the detailed information of the locked virtual object, such as after locking the virtual object, the detailed introduction of the locked virtual object is displayed on the screen of the mobile terminal "artillery [level 5] attack power 80 defense power 50" .
- the locked state only means that the locked virtual object becomes the action target of the master virtual object, and this application does not limit the specific behavior of the master virtual object to the locked virtual object.
- Master control virtual object refers to the virtual object that the mobile terminal has control authority. Under the control of the mobile terminal, the master virtual object can perform at least one behavior of adjusting body posture, walking, running, jumping, riding, driving, aiming, picking up, using throwing props, and attacking other virtual objects.
- the master virtual object may be a virtual character object controlled by the user in the game, a virtual pet object summoned by the user in the game, or a virtual vehicle object used by the user in the game.
- the first virtual object refers to a virtual object with the ability to move in the virtual environment.
- the first virtual object is a virtual object controlled by other users, or the first virtual object is an NPC (Non-player Character, non-player character ).
- the second virtual object also refers to a virtual object that has the ability to move in the virtual environment.
- the first virtual object and the second virtual object are only used to distinguish different virtual objects, that is, there may be a virtual object controlled by other users. (or NPC), and the second virtual object is an NPC (or other user-controlled virtual object); there may also be a first virtual object and a second virtual object that are both other user-controlled virtual objects; or the first virtual object and the second virtual object are both NPCs.
- Active locking means that the user actively controls the master virtual object to lock a certain virtual object
- passive locking means locking a certain virtual object according to preset locking rules. For example, if the user actively selects a virtual object to attack among the surrounding virtual objects, this behavior is called active locking; after the master virtual object controlled by the user is attacked by a virtual object in the surrounding virtual The virtual object is used as the target of the next attack, which is passive locking. Users can perform corresponding operations to switch between active locking and passive locking.
- the interface of the mobile terminal is usually provided with a locking indicator or a locking visual effect to remind the user of the currently locked virtual object.
- the interface of the mobile terminal In the passive locking mode, the interface of the mobile terminal usually does not set additional prompt information, and the locked virtual object can be directly observed and judged on the interface according to the specific behavior performed by the master virtual object on the locked virtual object.
- the first virtual object in the locked state and the second virtual object in the unlocked state are displayed on the mobile terminal.
- at least one of text, a lock indicator, and a lock visual effect is used to indicate that the first virtual object is in a locked state.
- add a box (lock indicator) around the outline of the first virtual object to indicate that the first virtual object is successfully locked display a crosshair (lock indicator) on the torso of the first virtual object to indicate that the first virtual object is successfully locked
- set The first virtual object shows a flashing effect (locked VFX)
- FIG. 3 shows a schematic diagram of a first virtual object being locked and a second virtual object being unlocked, the first virtual object 31 has a lock indicator 301 , and the second virtual object 32 has no lock indicator 301 .
- the lock indicator 301 indicates that the first virtual object is in a locked state, and corresponds to that the second virtual object 32 is not in a locked state.
- Step 240 receiving the shaking operation
- the shaking operation is an operation for shaking the body of the mobile terminal; in response to the user shaking the body of the mobile terminal, the mobile terminal receives the shaking operation.
- the mobile terminal determines that the shake operation is received through a signal output by a built-in motion sensor.
- the mobile terminal determines that the shaking operation is received through the signal change value collected by the motion sensor.
- the motion sensor may be at least one of an acceleration sensor, a gyro sensor, and a six-axis sensor (or a nine-axis sensor or a twelve-axis sensor) obtained by fusing the acceleration sensor and the gyro sensor.
- the mobile terminal confirms that the shaking operation is received through a signal received by the antenna.
- the receipt of the shaking operation is confirmed by the amplitude change value and/or the frequency change value of two adjacent received signals, or the receipt of the shaking operation is confirmed by the energy change value of two adjacent received signals operate.
- the impedances of two adjacent signals received by the antenna during transmission are inconsistent, resulting in inconsistent energy of the two adjacent signals.
- the signal received by the antenna may be a wireless fidelity wifi signal, a mobile network signal, a bluetooth signal, and the like.
- the mobile terminal confirms that the shaking operation is received through the image collected by the camera.
- the received shaking operation is confirmed by the similarity between two adjacent frames of images collected.
- a lock control in a first form is displayed on the screen of the mobile terminal, and the lock control in the first form is used to prompt to switch the virtual object in the locked state through the shaking operation.
- FIG. 4 shows a lock control 401 in a first form, and a prompt pattern of "shake the phone" is displayed on the lock control 401 in the first form.
- the lock control 302 of the third form is displayed, and the lock control 302 of the third form displays the text content of "unlock".
- Step 260 in the case that the shaking operation matches the second virtual object, switch the first virtual object in the locked state to the second virtual object.
- the mobile terminal determines the second virtual object matching the flicking operation according to the flicking direction of the flicking operation acquired by the motion sensor and the maximum acceleration (flicking acceleration) during the flicking process. Afterwards, the mobile terminal displays that the virtual object in the locked state is switched from the first virtual object to the second virtual object.
- the process of the mobile terminal displaying that the virtual object in the locked state is switched from the first virtual object to the second virtual object may be: after the mobile terminal determines the matching second virtual object according to the shaking operation, the second virtual object in the locked state A virtual object is switched to a second virtual object (virtual object switching is performed by the mobile terminal); optionally, after the mobile terminal determines the matching second virtual object according to the shaking operation, it reports the second virtual object to the server, and the The server performs the switching of the locked state, and feeds back the switching result to the mobile terminal, and the corresponding mobile terminal can display the second virtual object in the locked state and the first virtual object in the unlocked state according to the switching result.
- the mobile terminal confirms that the shaking operation is received by generating a sudden change according to the waveform of the signal received by the antenna. According to the change of the waveform after the mutation and the waveform before the mutation, determine the swinging direction. According to the energy change value of the signal before and after the waveform mutation, confirm the swing amplitude of the swing operation. The mobile terminal determines the second virtual object according to the direction and magnitude of the swing.
- the mobile terminal determines the swinging direction and swinging range of the swinging operation according to the image collected by the camera at the start moment of the swinging operation and the image collected at the end of the swinging operation, and further according to the The second virtual object can be determined by the moving direction and the swinging range.
- the virtual object displayed on the mobile terminal in the locked state is switched from the first virtual object to the second virtual object.
- the mobile terminal displays that the virtual object in the locked state is switched from the first virtual object to the second virtual object, including at least one of the following methods:
- the prompt information is used to indicate the swing direction of the swing operation; that is, to display the prompt information of the swing direction of the mobile terminal in the swing operation, and the form of prompt information includes at least one of graphics, arrows and text A sort of.
- FIG. 5 shows an interface where the mobile terminal switches the virtual object in the locked state from the first virtual object to the second virtual object.
- the position of the lock indicator 301 is transferred from the first virtual object 31 to the second virtual object 32 .
- Fig. 5 also shows an isosceles triangle 501, the two sides of the isosceles triangle 501 are longer than the third side, and the isosceles triangle 501 is used to prompt the swinging direction of the swinging operation, and the swinging direction is left at this time.
- the switching of the virtual object in the locked state is realized through the shaking operation, which avoids switching through multiple touches to lock the control, and facilitates the user to quickly switch the locked target.
- the master avatar controlled by the user is in a fierce battle with the first enemy character
- the user finds that the second enemy character has a short fatal flaw, as long as the master avatar attacks it, the second enemy can be defeated.
- side character the user switches the originally locked virtual character (the first enemy character) to the second enemy character through the swinging operation, and launches an attack on it. Therefore, setting the swinging operation to switch the locked target not only enriches the user's operation mode, but also improves the efficiency of the user switching the locked target, thereby improving the strategy of the game.
- FIG. 6 shows a flow chart of a virtual object switching method provided by an exemplary embodiment of the present application.
- the method is applied to the mobile terminal 120 shown in FIG. 2 as an example.
- the method includes :
- Step 620 displaying the first virtual object in the locked state and the second virtual object in the unlocked state
- the locked state indicates that the locked virtual object becomes the behavior target of the master virtual object
- the master virtual object is a virtual object that the mobile terminal has control authority.
- the first virtual object in the locked state and the second virtual object not in the locked state are displayed on the mobile terminal.
- the mobile terminal indicates that the first virtual object is in the locked state by means of at least one of text, a lock indicator, and a lock visual effect.
- Step 640 acquiring the swinging direction and the swinging acceleration of the swinging operation through the motion sensor
- the shaking operation is an operation for shaking the body of the mobile terminal.
- the swinging operation may be a single swinging operation or multiple swinging operations, a single swinging operation corresponds to one swinging direction, and there may be multiple swinging directions during multiple swinging operations.
- the swinging direction during the entire swinging operation can be determined according to the initial position and the end position of the mobile terminal.
- the mobile terminal acquires the first position of the mobile terminal at the start moment of the swing operation through the motion sensor, and then acquires the second position of the mobile terminal at the end of the swing operation through the motion sensor ; Based on the first position and the second position, determine a swing direction of a swing operation performed on the mobile terminal.
- the mobile terminal acquires the coordinates (x 1 , y 1 , z 1 ) of the first position at the start moment of the swing operation through the gyro sensor, and obtains the coordinates of the first position at the end moment of the swing operation through the gyro sensor.
- the coordinates of the second position are (x 2 , y 2 , z 2 ), and the swinging direction can be determined by calculating the coordinate vector. For example, if the coordinates of the first position are (2, 0, 0) and the coordinates of the second position are (1, 0, 0), then the swinging direction is left.
- the mobile terminal may also determine the swinging direction according to the acceleration sensor, or a six-axis sensor (or a nine-axis sensor or a twelve-axis sensor) obtained by fusing the acceleration sensor and the gyroscope sensor.
- Figure 7(a) shows that in the case of only making a single swing, the mobile terminal determines the swing direction based on the final position and the initial position;
- Figure 7(b) shows that when multiple swings are made In the case of , the mobile terminal determines the swing direction based on the final position and the initial position.
- the mobile terminal acquires the acceleration through the motion sensor.
- the acceleration changes from 0 to greater than the first threshold it means that the mobile terminal is shaken.
- the acceleration acquired by the mobile terminal through the motion sensor is greater than the first threshold.
- Time is determined as the starting time of the shaking operation.
- the mobile terminal continues to obtain the acceleration through the motion sensor.
- the mobile terminal judges that the acceleration changes from large to small, and continues to be less than the second threshold, it means that the mobile terminal stops being shaken and moves accordingly.
- the terminal determines the moment when the acceleration acquired by the motion sensor is less than the second threshold and reaches the duration threshold as the end moment of the shaking operation.
- the first threshold and the second threshold may be the same, for example, the first threshold and the second threshold may be 0m/s 2 ; the first threshold and the second threshold may be different, for example, the first threshold may be 0m/s s 2 , the second threshold may be 0.2m/s 2 .
- the maximum acceleration during the swinging operation is determined as the swinging acceleration by default; corresponding to a possible implementation Among them, after the mobile terminal determines the start time and end time of the swing operation, it can determine the maximum value of the acceleration between the start time and the end time as the swing acceleration of the swing operation.
- the mobile terminal acquires the acceleration according to the acceleration sensor, or a six-axis sensor (or a nine-axis sensor or a twelve-axis sensor) obtained by fusing the acceleration sensor and the gyroscope sensor.
- the mobile terminal acquires the swing direction and the swing acceleration of the swing operation.
- Step 660 based on the swing direction and swing acceleration, determine the second virtual object, and switch the first virtual object in the locked state to the second virtual object.
- the mobile terminal takes the first virtual object as a reference position in the virtual environment, and determines the first number of candidate virtual objects in the swinging direction of the first virtual object.
- the number of the first objects may be represented by n, and the value of n may be a positive integer.
- the value of n there may be one or more candidate virtual objects in the swinging direction of the first virtual object, that is, the value of n may be 1 or 3; corresponding to the case where the number of first objects is equal to 1 ( That is, when the value of n is equal to one), it means that the candidate virtual object is the second virtual object to be switched, and then the mobile terminal can directly determine the candidate virtual object in the swinging direction as the second virtual object;
- the number of the first objects is greater than 1 (that is, when the value of n is greater than 1)
- the second virtual object to be switched cannot be determined only based on the direction of the swing, and further based on the swing acceleration
- the second virtual object is selected from the plurality of candidate virtual objects.
- the corresponding mobile terminal determines the second virtual object from the n candidate virtual objects existing in the swinging direction based on the maximum value of the acceleration (swinging acceleration) during the swinging process.
- the mobile terminal when the number of first objects is greater than 1 (that is, when the value of n is greater than one), can set n acceleration intervals in the swing direction, and different acceleration intervals correspond to different candidate Where the virtual object is located, there are n candidate virtual objects, and n acceleration intervals are set correspondingly; then, according to the i-th acceleration interval where the swing acceleration is located, the candidate virtual object corresponding to the i-th acceleration interval is determined as the second virtual object; That is to say, when the maximum value of the swing acceleration is in the i-th acceleration interval during the swing process, the mobile terminal determines that the i-th candidate virtual object among the n virtual objects is the second virtual object.
- the n candidate virtual objects are in one-to-one correspondence with the n acceleration intervals, the n candidate virtual objects are sorted according to the distance from the first virtual object from near to far, and the n acceleration intervals are sorted according to the acceleration values from small to large.
- n and i are positive integers.
- the shaking direction acquired by the motion sensor is left, and there are two candidate virtual objects on the left side of the first virtual object, and the mobile terminal sets the two acceleration intervals corresponding to the left side as (0, 3), (3 , + ⁇ ), based on the fact that the maximum value of the swing acceleration of the swing operation acquired by the motion sensor is 2, then the first virtual object on the left side of the first virtual object is determined to be the second virtual object.
- the mobile terminal acquires preset k acceleration intervals, where k is greater than n;
- the j-th acceleration interval where the acceleration is located, when the maximum value of the swing acceleration is in the j-th acceleration interval during the shaking process, and j is not greater than n determine the j-th candidate virtual object among the n candidate virtual objects is the second virtual object; when the maximum value of the swing acceleration is in the jth acceleration interval (the swing acceleration is in the jth acceleration interval), and j is greater than n, determine the nth candidate virtual object in n
- the candidate virtual object is the second virtual object.
- the n candidate virtual objects are sorted according to the distance from the first virtual object from near to far, and the k acceleration intervals are sorted according to the acceleration values from small to large.
- k and j are positive integers.
- the mobile terminal obtains 8 preset acceleration intervals, which are (0, 3), (3, 6), (6, 9), (9, 12) , (12, 15), (15, 18), (18, 21) and (21, + ⁇ ). If the maximum value of the shaking acceleration during the shaking process is 5 (falling into the second acceleration interval), then the second virtual object candidate on the left side of the first virtual object is determined to be the second virtual object. If the maximum value of the swinging acceleration during the swinging process is 14 (falling into the fifth acceleration interval), the third candidate virtual object on the left side of the first virtual object is determined to be the second virtual object.
- the above k acceleration intervals may be obtained based on the preset settings of the server supporting the application program, or may be obtained based on the user's settings on the application program, for example, the user adjusts the swing operation on the application program.
- Sensitivity which is to adjust the span of the acceleration interval and/or the number of acceleration intervals.
- the second virtual object is determined in the virtual environment. After that, the mobile terminal displays that the locked virtual object is switched from the first virtual object to the second virtual object.
- the possible display methods have been described in detail in step 260 above, and will not be repeated here.
- the motion sensor receives the swinging direction and the swinging acceleration of the swinging operation, determines the second virtual object according to the swinging direction and the swinging acceleration, and finally switches the virtual object in the locked state from the first virtual object
- the motion sensor receives the swinging direction and the swinging acceleration of the swinging operation, determines the second virtual object according to the swinging direction and the swinging acceleration, and finally switches the virtual object in the locked state from the first virtual object
- a specific implementation method of switching the locking target according to the shaking operation is provided, which ensures high efficiency of switching the locking target.
- FIG. 8 shows a flow chart of a virtual object switching method provided by an exemplary embodiment of the present application.
- the method is applied to the mobile terminal 120 shown in FIG. 2 as an example.
- the method includes :
- Step 820 displaying the first virtual object in the locked state and the second virtual object in the unlocked state
- the locked state indicates that the locked virtual object becomes the behavior target of the master virtual object
- the master virtual object is a virtual object that the mobile terminal has control authority.
- the first virtual object in the locked state and the second virtual object not in the locked state are displayed on the mobile terminal.
- the mobile terminal indicates that the first virtual object is in the locked state by means of at least one of text, a lock indicator, and a lock visual effect.
- Step 840 determine the swinging direction and swinging range of the swinging operation through the image collected by the camera;
- the mobile terminal uses the camera to acquire the first image collected by the camera at the start of the swing operation, and obtains the second image collected by the camera at the end of the swing operation; then, based on the first image and The feature point matching is performed on the second image to determine the swinging direction of the swinging operation.
- the mobile terminal performs feature point tracking on the images collected by the camera to determine the swing direction of the swing operation.
- the feature point tracking may use a tracking algorithm based on visual odometry, which is not limited in this application.
- the feature point tracking adopts the KLT (Kanade-Lucas) optical flow tracking algorithm.
- the feature point tracking uses the ORB feature descriptor extracted based on the ORB (Oriented FAST and Rotated BRIEF, fast feature point extraction and description) algorithm for feature point tracking.
- ORB Oriented FAST and Rotated BRIEF, fast feature point extraction and description
- the mobile terminal collects images through the camera, and obtains the similarity between two adjacent frames of images, and if the similarity between the two adjacent frames of images is relatively large, it means that no shaking operation has occurred on the mobile terminal; Conversely, if the similarity between two adjacent frames of images is small, it means that the mobile terminal has a shaking operation; the similarity between the first two adjacent frames of images obtained by the corresponding mobile terminal through the camera is less than the third threshold If it indicates that the shaking operation is started, the previous frame of the first two adjacent frames of images is determined as the first image, and the time when the first image is acquired is determined as the starting time of the shaking operation.
- the mobile terminal After the mobile terminal obtains the image through the camera, it will calculate the similarity between two adjacent frames of images.
- the similarity between two adjacent frames of images can be calculated according to the feature points. When the number of feature points that appear repeatedly between adjacent two frames of images is less than the first number threshold, it is considered that there is a gap between the adjacent two frames of images.
- the similarity degree is less than the third threshold, at this time, the previous frame of the two adjacent frames of images is determined as the first image; optionally, a similarity determination model can also be set, and the two adjacent frames of images are input into the similarity determination In the model, the similarity between two adjacent frames of images can be output, and the relationship between the similarity and the third threshold is compared. When the similarity is less than the third threshold, the previous frame of the two adjacent frames of images is determined as the first images, and determine the acquisition moment of the first image as the starting moment of the shaking operation.
- the mobile terminal determines that the similarity between two adjacent frames of images is less than the third threshold, and the counter is incremented by 1.
- the counter is incremented by 1 again, and if within the second preset period of time, the accumulated value of the counter reaches the preset value , it is determined that a shaking operation has been detected, and the previous frame image among the two adjacent frame images that first reaches the third threshold is determined as the first image.
- the mobile terminal determines that the similarity between two adjacent frames of images is small, it means that the mobile terminal stops being shaken, corresponding to the second adjacent two frames of images acquired by the mobile terminal through the camera.
- the similarity is greater than the fourth threshold, the next frame in the second adjacent two frame images is determined as the second image, and the moment of acquiring the second image is determined as the end moment of the shaking operation; the second image is acquired The moment of is also the acquisition moment of the second image;
- the mobile terminal after the mobile terminal obtains the image through the camera, it will calculate the similarity between two adjacent frames of images.
- the number of feature points repeatedly appearing between two adjacent frames of images is greater than the second number threshold, it is considered that the similarity between the adjacent two frames of images is greater than the fourth threshold, and at this time the adjacent The latter frame among the two frames of images is determined as the second image.
- two adjacent frames of images can also be input into the similarity determination model, and the similarity between two adjacent frames of images can be output, and the relationship between the similarity and the fourth threshold is compared, and when the similarity is greater than the fourth threshold , determine the second frame after the two adjacent frames of images as the second image, and determine the acquisition time of the second image as the end time of the shaking operation.
- the mobile terminal After the mobile terminal obtains the image through the camera, it determines that the similarity between two adjacent frames of images is greater than the fourth threshold, and then adds 1 to the counter. If within the third preset time period, the mobile terminal determines that another two adjacent frames The similarity between the frame images is also greater than the fourth threshold, and the counter is added by 1 again. If within the fourth preset time period, the accumulated value of the counter reaches the second preset value, it is determined that the stop shaking is detected, and the counter will The next frame of images among the two adjacent frames of images reaching the second preset value is determined as the second image.
- determining the first image and the second image can further determine the swinging direction and swinging amplitude of the swinging operation.
- the mobile terminal can determine the swinging direction of the swinging operation according to the displacement direction of the feature points matched in the first image and the second image.
- the numerical value of the swing amplitude of the swing operation can be obtained through mapping.
- the mobile terminal may be preset with a corresponding relationship between the similarity and the swing amplitude.
- Step 860 Determine the second virtual object based on the swing direction and swing amplitude, and switch the locked first virtual object to the second virtual object.
- the mobile terminal determines the second object number of the candidate virtual objects in the swing direction with the first virtual object as the reference position, and the second object number can be represented by m , m is a positive integer; when the number of second objects is equal to one (that is, when the value of m is equal to one), the mobile terminal can directly determine a candidate virtual object existing in the swinging direction as the second virtual object.
- the mobile terminal determines the second virtual object from the m candidate virtual objects existing in the swing direction.
- the mobile terminal sets m amplitude intervals corresponding to the swing direction; In this case, the mobile terminal determines the p-th virtual object among the m virtual objects as the second virtual object.
- the m candidate virtual objects are in one-to-one correspondence with the m amplitude intervals, the m candidate virtual objects are sorted according to the distance from the first virtual object from near to far, and the m amplitude intervals are sorted according to the amplitude values from small to large.
- the shaking direction is left, and there are two candidate virtual objects on the left side of the first virtual object, and the mobile terminal sets the two amplitude intervals corresponding to the left side as (0, 3), (3, + ⁇ ) , the maximum value of the swing amplitude obtained based on the similarity is 2, then the first candidate virtual object on the left side of the first virtual object is determined to be the second virtual object.
- the mobile terminal acquires preset R amplitude intervals, where R is greater than m; after that, when the swing amplitude is at the rth amplitude interval, and r is not greater than m, determine the r-th candidate virtual object among the m candidate virtual objects as the second virtual object; when the swing amplitude is in the r-th amplitude interval, and r is greater than m Next, determine the m-th candidate virtual object among the m candidate virtual objects as the second virtual object.
- the m candidate virtual objects are sorted according to the distance from the first virtual object from near to far, and the R amplitude intervals are sorted according to the amplitude values from small to large.
- the mobile terminal acquires 8 preset amplitude intervals, which are (0, 3), (3, 6), (6, 9), (9, 12) , (12, 15), (15, 18), (18, 21) and (21, + ⁇ ). If the shaking amplitude during the shaking process is 5 (falling into the second amplitude range), then the second virtual object candidate on the left side of the first virtual object is determined to be the second virtual object. If the swing amplitude is 14 during the swing process (falling into the 5th acceleration interval), the third candidate virtual object on the left side of the first virtual object is determined to be the second virtual object.
- the mobile terminal determines the second virtual object in the virtual environment. After that, the mobile terminal displays that the locked virtual object is switched from the first virtual object to the second virtual object.
- the possible display methods have been described in detail in step 260 above, and will not be repeated here.
- the reception of the shaking operation is confirmed through the built-in camera of the mobile terminal, the direction and magnitude of the shaking operation are determined according to the images collected by the camera, and the second virtual virtual machine is determined according to the direction and magnitude of the shaking. object, and finally switch the virtual object in the locked state from the first virtual object to the second virtual object, providing a specific implementation method for switching the locking target according to the swing operation, and ensuring the high efficiency of switching the locking target.
- FIG. 9 is a flowchart of a virtual object switching method provided by an exemplary embodiment of the present application. The method is applied to the mobile terminal 120 shown in FIG. 1 for illustration. The method includes:
- Step 910 display the locking control of the second form
- FIG. 10(a) shows a lock control 1001 in a second form.
- the lock control 1001 in the second form is located in the lower right corner area of the interface of the mobile terminal, which is convenient for users to quickly perform lock operate.
- Step 920 displaying at least two virtual objects
- the at least two virtual objects include the first virtual object which is not in the locked state.
- FIG. 10( a ) shows five virtual objects.
- Step 930 in response to the first trigger operation on the lock control in the second form, determine to execute the lock operation
- the first trigger operation includes at least one of long press trigger, single click trigger, double click trigger, drag trigger and pressure trigger.
- the mobile terminal determines to perform a lock operation.
- Step 940 when the first virtual object satisfies the locking condition, display the first virtual object in the locked state
- displaying the first virtual object in the locked state includes at least one of the following methods:
- the mobile terminal acquires the distance between each virtual object and the master virtual object, and determines the virtual object with the smallest distance as the first virtual object, and performs a locking operation on the first virtual object, correspondingly displaying that it is in a locked state The first virtual object of .
- the distance between at least two virtual objects and the master virtual object is less than the distance threshold, and the virtual object that falls into the direction of the master virtual object is the first virtual object, and the virtual object that is in the locked state is displayed a dummy object.
- the mobile terminal obtains the distance between each virtual object and the master virtual object, compares the relationship between each distance and the distance threshold, and screens out the virtual objects whose distance is smaller than the distance threshold, and then screens out the master virtual object.
- the virtual object facing the object is used as the first virtual object, and a locking operation is performed on it to display the first virtual object in a locked state.
- the distance between at least two virtual objects and the master virtual object is less than the distance threshold, and the virtual object with the smallest absolute biological value is the first virtual object, and the first virtual object in the locked state is displayed,
- the biological value is used to measure the degree of wear and tear of the virtual object in the virtual environment, and the absolute biological value is the remaining biological value of the virtual object.
- the mobile terminal obtains the distance between each virtual object and the master virtual object, and compares the relationship between each distance and the distance threshold, first filters out the virtual objects whose distance is smaller than the distance threshold, and then obtains the distance between each virtual object.
- Absolute biological value determining the virtual object with the smallest absolute biological value as the first virtual object, so as to perform a locking operation on the first virtual object.
- the relative biological value is the ratio of the virtual object's remaining biological value to the full biological value.
- the mobile terminal obtains the distance between each virtual object and the master virtual object, and compares the relationship between each distance and the distance threshold, first filters out the virtual objects whose distance is smaller than the distance threshold, and then obtains the distance between each virtual object.
- the virtual object with the smallest relative biological value is determined as the first virtual object, so as to perform a locking operation on the first virtual object.
- a relative biological value may be a ratio between an absolute biological value and a full biological value.
- the absolute biological value is the remaining biological value of the virtual object.
- the display interface of the mobile terminal is switched from FIG. A lock indicator 301 is displayed on the object 301 .
- Step 950 displaying the lock control of the first form
- the first virtual object 31 is locked in at least two virtual objects, and the display interface of the mobile terminal switches from FIG. 10(a) to FIG. 10(b ), with reference to FIG. 10( b ), the lock control 401 in the first form prompts the user to switch the virtual object in the locked state through a flick operation.
- FIG. 10( b ) also shows the first virtual object 31 , the second virtual object 32 and the lock indicator 301 .
- Step 960 displaying the locking control of the third form
- the lock control in the third form is displayed on the interface of the mobile terminal.
- the lock control of the third form is used to unlock the first virtual object.
- FIG. 10(c) shows a lock control 302 in a third form.
- the mobile terminal executes the unlock operation, and the mobile terminal interrupts the virtual object switching method. If the mobile terminal does not receive the second trigger operation through the lock control 302 of the third form, the following step 970 is performed.
- the second trigger operation includes at least one of long press trigger, single click trigger, double click trigger, drag trigger and pressure trigger.
- Step 970 displaying the first virtual object in the locked state and the second virtual object in the unlocked state
- the mobile terminal displays the first virtual object in the locked state and the second virtual object in the unlocked state.
- the second virtual object belongs to one of the at least two virtual objects in step 920 above.
- FIG. 10(c) shows a first virtual object 31 in a locked state and a second virtual object 32 not in a locked state.
- the second virtual object belongs to at least two virtual objects in the above step 920 one of.
- Step 980 receiving the shaking operation
- the shaking operation refers to the operation of shaking the body of the mobile terminal.
- the mobile terminal receives the shaking operation through a built-in motion sensor
- the motion sensor includes an acceleration sensor, a gyroscope sensor, a six-axis sensor (or a nine-axis sensor or a twelve-axis sensor) after fusion of the acceleration sensor and the gyroscope sensor .
- the mobile terminal confirms that the shaking operation is received through the image collected by the camera.
- the received shaking operation is confirmed by the similarity between two adjacent frames of images collected.
- the mobile terminal confirms that the shaking operation is received through a signal received by the antenna.
- the mobile terminal confirms that the shaking operation is received through the received energy change values of two adjacent signals.
- the mobile terminal may receive the shaking operation through other sensors.
- the optical sensor can confirm the receipt of the shaking operation through the change of the light intensity caused by the shaking operation. It is also possible to receive the shaking operation through a temperature sensor, a magnetic field sensor, and the like.
- Step 990 in the case that the shaking operation matches the second virtual object, switch the first virtual object in the locked state to the second virtual object.
- the mobile terminal determines the second virtual object that matches the flicking operation according to the flicking direction of the flicking operation and the maximum acceleration during the flicking process acquired by the motion sensor. Afterwards, the mobile terminal displays that the virtual object in the locked state is switched from the first virtual object to the second virtual object.
- the mobile terminal confirms that the shaking operation is received by generating a sudden change according to the waveform of the signal received by the antenna. According to the change of the waveform after the mutation and the waveform before the mutation, determine the swinging direction. According to the energy change value of the signal before and after the waveform mutation, confirm the swing amplitude of the swing operation. The mobile terminal determines the second virtual object according to the direction and magnitude of the swing. Afterwards, the mobile terminal displays that the virtual object in the locked state is switched from the first virtual object to the second virtual object.
- the mobile terminal determines the swinging direction and swinging range of the swinging operation according to the image collected by the camera at the start moment of the swinging operation and the image collected at the end of the swinging operation, and further according to the The second virtual object can be determined by the moving direction and the swinging range. Afterwards, the mobile terminal displays that the virtual object in the locked state is switched from the first virtual object to the second virtual object.
- FIG. 10( d ) shows the second virtual object 32 in a locked state, the locked state is switched from the first virtual object 31 to the second virtual object 32 , and no lock indicator is displayed on the first virtual object 31 . It can be noted that FIG. 10( d ) also shows a hint graphic 501 of the swing direction.
- the mobile terminal may perform an unlock operation in response to the second trigger operation received by the lock control in the third form. After performing the unlocking operation, the mobile terminal stops switching the locking target.
- the interface of the mobile terminal is provided with a first form of lock control (prompt information for shaking operation), a second form of lock control (capable of performing a lock operation) and a third form of lock control (capable of performing a lock operation). Execute the unlock operation), and set the prompt information of the swing direction, which improves the specific implementation of the virtual object switching method, making the switching method closer to the user's operating habits.
- FIG. 11 shows a flow chart of a virtual object switching method provided by an exemplary embodiment of the present application.
- the method is applied to a smart phone for example.
- the method includes:
- the mobile phone starts to execute the switching process of locking the target.
- Step 1102 judging whether the user has clicked the target locking button on the main interface
- the mobile phone judges whether the user clicks the target lock button on the main interface.
- the target lock button is a button used to actively lock the target character on the main interface.
- a target lock button is provided at the lower right corner of the mobile phone screen. Under normal circumstances, if there is no lockable target within a certain range from the player character, the user's trigger operation on the target lock button has no effect. If there is a lockable target within a certain range from the player character, the user's trigger operation on the target lock button triggers the lock.
- step 1104 If the user clicks the target locking button on the main interface, perform step 1104; if the user does not click the target locking button on the main interface, perform step 1103.
- Step 1103, do not perform target locking switching
- the mobile phone does not receive the trigger operation of the target locking button, the mobile phone does not perform target locking switching.
- the trigger operation includes long-press trigger, single-click trigger, double-click trigger, drag trigger, pressure trigger, and so on.
- Step 1104 judging whether there is a target that can be locked within the field of vision
- the mobile phone determines whether there is a target that can be locked within the field of vision of the player character. If there is a target that can be locked, go to step 1106; if there is no target that can be locked, go to step 1105.
- Step 1105 do not perform target locking
- the mobile phone determines that there is no target that can be locked within the field of view of the player character, and the mobile phone does not perform target locking, that is, the mobile phone does not lock the virtual object within the field of view of the player character.
- Step 1106 the number of targets currently meeting the locked state is greater than 1;
- the mobile phone judges whether the number of targets in the player character's field of vision that meet the locked state is greater than 1. If the number of targets meeting the locked state is greater than 1, the mobile phone will start a thread for switching locked targets according to the shaking operation, that is, the mobile phone will then execute step 1108 . If the number of targets meeting the locked state is equal to 1, then the mobile phone judges that the locked target cannot be switched at present, that is, the mobile phone does not start the thread for switching the locked target according to the shaking operation, that is, the mobile phone will start step 1107 afterwards.
- Step 1107 do not start the acceleration sensor
- the mobile phone does not activate the accelerometer.
- the mobile phone Based on the fact that the number of targets currently in the locked state is greater than 1, the mobile phone activates the acceleration sensor.
- the acceleration sensor can be used to determine the swing direction and the swing acceleration of the subsequent swing operation.
- Step 1109 whether the mobile phone is shaken
- the mobile phone judges whether the shaking operation is received, and if so, further judges the shaking direction of the shaking operation. If not, go to step 1110 .
- Step 1110 do not perform target locking
- Step 1111 the position after the swing is higher than the position before the swing
- the position of the mobile phone after the confirmed shaking is higher than the position before the shaking (the shaking direction is upward).
- Step 1112 the position after the swing is leftward compared to the position before the swing
- the position of the mobile phone after confirming the shaking is leftward compared to the position before the shaking (the shaking direction is to the left).
- Step 1113 the position after the swing is to the right of the position before the swing
- the position of the mobile phone after confirming the shaking is to the right (the direction of the shaking is right) compared to the position before the shaking.
- Step 1114 the position after the swing is lower than the position before the swing
- the position of the mobile phone after the confirmed shaking is lower than the position before the shaking (the shaking direction is downward).
- Step 1115 obtaining the shaking acceleration value of the mobile phone
- the mobile phone obtains the shake acceleration value.
- the mobile phone obtains the maximum value of the shaking acceleration during the shaking process through an acceleration sensor.
- Step 1116 determine the acceleration dynamic region where the swing acceleration is located
- the mobile phone determines the acceleration dynamic area where the swing acceleration is located, and determines the locked target after switching according to the acceleration dynamic area.
- the mobile phone determines an acceleration dynamic area matching the maximum value of the swing acceleration according to the maximum value of the swing acceleration during the swing process.
- the mobile phone presets a certain number of acceleration dynamic areas in advance, or the mobile phone sets the same number of acceleration dynamic areas according to the number of virtual objects existing in the swinging direction of the player character in the virtual environment.
- Step 1117 lock the target and switch backward
- the mobile phone controls the locked target to switch backwards.
- Step 1118 switch the locked target to the left
- the mobile phone controls the locked target to switch to the left.
- Step 1119 lock the target and switch to the right
- the mobile phone controls the locked target to switch to the right.
- Step 1120 lock the target and switch forward
- the mobile phone controls the locked target to switch forward.
- Step 1121 whether the user clicks the unlock button
- the mobile phone determines whether the user clicks the unlock button. If the user clicks the unlock button, the mobile phone stops the switching of virtual objects, and closes the locking logic of the application program, and exits the locking process.
- step 1122 is executed.
- Step 1122 turn off the acceleration sensor
- the phone exits the locking process and turns off the acceleration sensor.
- Fig. 12 is a structural block diagram of a device for switching virtual objects provided by an exemplary embodiment of the present application, the device includes:
- a display module 1201, configured to display the first virtual object in the locked state and the second virtual object in the unlocked state, the locked state indicates that the locked virtual object becomes the behavior target of the master virtual object;
- the receiving module 1202 is configured to receive a shaking operation, where the shaking operation is an operation for shaking the body of the mobile terminal;
- the switching module 1203 is further configured to switch the first virtual object in the locked state to the second virtual object when the shaking operation matches the second virtual object.
- the display module 1201 is further configured to display the lock indicator on the second virtual object, and cancel the display of the lock indicator on the first virtual object.
- the display module 1201 is further configured to display the locking visual effect on the second virtual object, and cancel the display of the locking visual effect on the first virtual object.
- the display module 1201 is also used to display prompt information, the prompt information is used to indicate the swing direction of the swing operation, and the display form of the prompt information includes at least one of graphics, arrows and text kind.
- the receiving module 1202 is also configured to obtain the swinging direction and the swinging acceleration of the swinging operation through the motion sensor, and the swinging acceleration is the maximum acceleration during the swinging operation.
- the switching module 1203 is further configured to determine the second virtual object based on the swing direction and the swing acceleration, and switch the first virtual object in the locked state to the second virtual object.
- the switching module 1203 is also used to:
- the first object quantity of the candidate virtual objects in the swinging direction is determined.
- the candidate virtual object in the swinging direction is determined as the second virtual object.
- the second virtual object is determined from the candidate virtual objects in the swing direction based on the swing acceleration.
- the switching module 1203 is also used to:
- n acceleration intervals in the swing direction are set, and different acceleration intervals correspond to positions of different candidate virtual objects.
- the candidate virtual object on the i-th acceleration interval is determined as the second virtual object.
- the candidate virtual objects are sorted according to the distance from the first virtual object from near to far, and the n acceleration intervals are sorted according to the acceleration values from small to large.
- the switching module 1203 is also used to:
- k preset acceleration intervals are acquired, and k is greater than the first number of objects.
- the jth candidate virtual object among the candidate virtual objects is determined as the second virtual object.
- the nth candidate virtual object among the candidate virtual objects is the second virtual object, and n is equal to the first object number.
- k and j are positive integers
- the candidate virtual objects are sorted according to the distance from the first virtual object from near to far
- the k acceleration intervals are sorted according to the acceleration values from small to large.
- the receiving module 1202 is also used to:
- the first position of the mobile terminal is acquired through the motion sensor, and the first position is the position of the mobile terminal at the moment of starting the swing operation.
- the second position of the mobile terminal is acquired through the motion sensor, and the second position is the position of the mobile terminal at the end of the swing operation.
- the swinging direction of the swinging operation is determined.
- the receiving module 1202 is also used to:
- the moment when the acceleration obtained by the motion sensor is greater than the first threshold is determined as the start moment of the swinging operation.
- the time when the acceleration acquired by the motion sensor is less than the second threshold and reaches the time threshold is determined as the end time of the swinging operation.
- the maximum value of the acceleration between the start time and the end time is determined as the swing acceleration.
- the receiving module 1202 is further configured to determine the swing direction and swing amplitude of the swing operation through images collected by the camera.
- the switching module 1203 is further configured to determine a second virtual object based on the swing direction and swing amplitude, and switch the first virtual object in the locked state to the second virtual object.
- the switching module 1203 is also used to:
- a second object quantity of the candidate virtual objects in the swinging direction is determined.
- the candidate virtual object in the swinging direction is determined as the second virtual object.
- the second virtual object is determined from the candidate virtual objects in the swing direction based on the swing amplitude.
- the receiving module 1202 is also used to:
- a second image collected by the camera is obtained, and the second image is obtained by the camera at the end of the swinging operation.
- the feature point matching is performed based on the first image and the second image, and the swinging direction of the swinging operation is determined.
- the receiving module 1202 is also used to:
- the similarity between the first two adjacent frames of images acquired by the camera is less than a third threshold, the previous frame of the first two adjacent frames of images is determined as the first image;
- the swing amplitude of the swing operation is determined.
- the display module 1201 is further configured to display a lock control in a first form, and the lock control in the first form is used to prompt switching of a virtual object in a locked state through a shaking operation.
- the display module 1201 is further configured to display at least two virtual objects, where the at least two virtual objects include the first virtual object that is not in a locked state.
- the display module 1201 is further configured to display the first virtual object in a locked state when the first virtual object satisfies the locking condition.
- the display module 1201 is also used for:
- the absolute biological value is virtual
- the biological value is used to measure the degree of wear and tear of the virtual object in the virtual environment.
- the relative biological value is virtual The ratio of the subject's remaining biological value to its full biological value.
- the display module 1201 is also configured to display the lock control in the second form.
- the display module 1201 is further configured to determine to perform a locking operation in response to the first trigger operation on the locking control in the second form.
- the display module 1201 is also configured to display a lock control in a third form.
- the display module 1201 is further configured to determine to perform an unlock operation in response to a second trigger operation on the lock control in the third form.
- the above-mentioned device realizes the switching of the virtual object in the locked state through the shaking operation, avoids switching through multiple touches of the locking control, and facilitates the user to quickly switch the locking target.
- the master avatar controlled by the user is in a fierce battle with the first enemy character
- the user finds that the second enemy character has a short fatal flaw, as long as the master avatar attacks it, the second enemy can be defeated.
- side character the user switches the originally locked virtual character (the first enemy character) to the second enemy character through the swinging operation, and launches an attack on it. Therefore, setting the swinging operation to switch the locked target not only enriches the user's operation mode, but also improves the efficiency of the user switching the locked target, thereby improving the strategy of the game.
- Fig. 13 shows a structural block diagram of a computer device 1300 provided by an exemplary embodiment of the present application.
- the computer device 1300 can be a portable mobile terminal, such as: smart phone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III, moving picture expert compression standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Motion Picture Expert compresses standard audio levels 4) Players, laptops or desktops.
- the computer device 1300 may also be called user equipment, portable terminal, laptop terminal, desktop terminal, or other names.
- a computer device 1300 includes: a processor 1301 and a memory 1302 .
- the processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like.
- Processor 1301 can adopt at least one hardware form in DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, programmable logic array) accomplish.
- Processor 1301 may also include a main processor and a coprocessor, and the main processor is a processor for processing data in a wake-up state, also called a CPU (Central Processing Unit, central processing unit); the coprocessor is Low-power processor for processing data in standby state.
- CPU Central Processing Unit, central processing unit
- the coprocessor is Low-power processor for processing data in standby state.
- the processor 1301 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen.
- the processor 1301 may also include an AI (Artificial Intelligence, artificial intelligence) processor, where the AI processor is used to process computing operations related to machine learning.
- AI Artificial Intelligence, artificial intelligence
- Memory 1302 may include one or more computer-readable storage media, which may be non-transitory.
- the memory 1302 may also include high-speed random access memory and non-volatile memory, such as one or more magnetic disk storage devices and flash memory storage devices.
- the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 1301 to realize the virtual object provided by the method embodiment in this application switching method.
- the computer device 1300 may optionally further include: a peripheral device interface 1303 and at least one peripheral device.
- the processor 1301, the memory 1302, and the peripheral device interface 1303 may be connected through buses or signal lines.
- Each peripheral device can be connected to the peripheral device interface 1303 through a bus, a signal line or a circuit board.
- the peripheral equipment may include: a display screen 1304 and a camera assembly 1305 .
- computing device 1300 also includes one or more sensors 1306 .
- the one or more sensors 1306 include, but are not limited to: acceleration sensors, gyro sensors, pressure sensors, optical sensors, and proximity sensors.
- FIG. 13 does not constitute a limitation to the computer device 1300, and may include more or less components than shown in the figure, or combine certain components, or adopt a different component arrangement.
- the present application also provides a computer-readable storage medium, at least one program is stored in the storage medium, and the at least one program is loaded and executed by a processor to implement the virtual object switching method provided by the above method embodiments.
- the present application provides a computer program product comprising computer instructions stored in a computer-readable storage medium.
- the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the virtual object switching method provided by the above method embodiments.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- Optics & Photonics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
一种虚拟对象的切换方法、装置、设备、介质及程序产品,属于虚拟环境技术领域。方法包括:显示处于锁定状态的第一虚拟对象和未处于锁定状态的第二虚拟对象(220);接收甩动操作(240);在甩动操作与第二虚拟对象匹配的情况下,将处于锁定状态的第一虚拟对象切换为第二虚拟对象(260)。该方法可以提高用户切换锁定目标的效率。
Description
本申请要求于2021年12月10日提交的申请号为202111506115.4、发明名称为“虚拟对象的切换方法、装置、设备、介质及程序产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请实施例涉及虚拟环境技术领域,特别涉及一种虚拟对象的切换方法、装置、设备、介质及程序产品。
在各式各样的游戏中,用户通过从若干个敌方角色中锁定一个敌方角色进行攻击,并且,在战斗过程中,用户经常需要切换锁定的敌方角色。
在相关技术中,用户界面设置有锁定控件,当用户第一次触控锁定控件,终端自动从若干个敌方角色中锁定第一敌方角色,当用户再次触控锁定控件,终端按照预设的切换顺序,将第一敌方角色切换为第二敌方角色进行锁定。
然而,在切换锁定的敌方角色时仅根据预设的切换顺序进行切换,若用户想要攻击的敌方角色处于切换顺序的末尾,通过相关技术进行切换需要多次触控锁定控件,角色切换效率低下。
发明内容
本申请提供了一种虚拟对象的切换方法、装置、设备、介质及程序产品。所述技术方案如下:
根据本申请的一方面,提供了一种虚拟对象的切换方法,所述方法由移动终端执行,所述方法包括:
显示处于锁定状态的第一虚拟对象和未处于锁定状态的第二虚拟对象,锁定状态指示被锁定的虚拟对象成为主控虚拟对象的行为目标;
接收甩动操作,甩动操作是用于甩动移动终端的机身的操作;
在甩动操作与第二虚拟对象匹配的情况下,将处于锁定状态的第一虚拟对象切换为第二虚拟对象。
根据本申请的另一方面,提供了一种虚拟对象的切换装置,所述装置包括:
显示模块,用于显示处于锁定状态的第一虚拟对象和未处于锁定状态的第二虚拟对象,锁定状态指示被锁定的虚拟对象成为主控虚拟对象的行为目标;
接收模块,用于接收甩动操作,甩动操作是用于甩动装置的操作;
切换模块,还用于在甩动操作与第二虚拟对象匹配的情况下,将处于锁定状态的第一虚拟对象切换为第二虚拟对象。
根据本申请的一个方面,提供了一种计算机设备,所述计算机设备包括:处理器和存储器,所述存储器存储有计算机程序,所述计算机程序由所述处理器加载并执行以实现如上所述的虚拟对象的切换方法。
根据本申请的另一方面,提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序由处理器加载并执行以实现如上所述的虚拟对象的切换方法。
根据本申请的另一方面,提供了一种计算机程序产品,所述计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述方面提供的 虚拟对象的切换方法。
本申请实施例提供的技术方案带来的有益效果至少包括:
通过甩动操作实现切换处于锁定状态的虚拟对象,避免了通过多次触控锁定控件进行切换,方便了用户快速切换锁定目标。例如,在用户控制的主控虚拟角色正在与第一敌方角色激烈战斗时,用户发现第二敌方角色出现了短暂的致命破绽,只要主控虚拟角色向其发起攻击即能击败第二敌方角色,通过甩动操作用户将原来锁定的虚拟角色(第一敌方角色)快速切换为第二敌方角色,并对其发起攻击。因此,设置甩动操作切换锁定目标,不仅丰富了用户的操作方式,还提高了用户切换锁定目标的效率,进而提高了游戏的策略性。
图1示出了本申请一个示例性实施例提供的计算机***的结构框图;
图2示出了本申请一个示例性实施例提供的虚拟对象的切换方法的流程图;
图3示出了本申请一个示例性实施例提供的处于锁定状态的第一虚拟对象和未处于锁定状态的第二虚拟对象的示意图;
图4示出了本申请一个示例性实施例提供的甩动操作的提示信息的示意图;
图5示出了本申请一个示例性实施例提供的甩动方向的提示信息的示意图;
图6示出了本申请另一个示例性实施例提供的虚拟对象的切换方法的流程图;
图7示出了本申请一个示例性实施例提供的确定甩动方向的示意图;
图8示出了本申请另一个示例性实施例提供的虚拟对象的切换方法的流程图;
图9示出了本申请另一个示例性实施例提供的虚拟对象的切换方法的流程图;
图10示出了本申请一个示例性实施例提供的虚拟对象的切换过程的示意图;
图11示出了本申请另一个示例性实施例提供的虚拟对象的切换方法的流程图;
图12示出了本申请一个示例性实施例提供的虚拟对象的切换装置的结构框图;
图13示出了本申请一个示例性实施例提供的计算机设备的结构框图。
图1示出了本申请一个示例性实施例提供的计算机***的结构框图。该计算机***100包括:移动终端120和服务器140。
移动终端120上运行有支持虚拟环境的应用程序。该应用程序可以是三维地图程序、横版射击、横版冒险、横版过关、横版策略、虚拟现实(Virtual Reality,VR)应用程序、增强现实(Augmented Reality,AR)程序中的任意一种。移动终端120是用户使用的移动终端,用户使用移动终端120控制位于三维虚拟环境中的主控虚拟对象进行活动,该活动包括但不限于:调整身体姿态、行走、奔跑、跳跃、骑行、驾驶、瞄准、拾取、使用投掷类道具、攻击其他虚拟对象中的至少一种。示例性的,主控虚拟对象是虚拟人物,比如仿真人物对象或动漫人物对象。示例性的,用户通过虚拟环境画面上的UI控件来控制主控虚拟角色进行活动。
移动终端120通过无线网络或有线网络与服务器140相连。
服务器140包括一台服务器、多台服务器、云计算平台和虚拟化中心中的至少一种。示例性的,服务器140包括处理器144和存储器142,存储器142又包括接收模块1421、控制模块1422和发送模块1423,接收模块1421用于接收应用程序发送的请求,如攻击敌人;控制模块1422用于控制虚拟环境画面的渲染;发送模块1423用于向应用程序发送响应,如向应用程序发送攻击造成的伤害值。服务器140用于为支持三维虚拟环境的应用程序提供后台服务。可选地,服务器140承担主要计算工作,移动终端120承担次要计算工作;或者,服务器140承担次要计算工作,移动终端120承担主要计算工作。
可选的,上述应用程序运行在不同操作***平台(安卓或IOS)上。可选的,运行有该应用程序的移动终端140的设备类型相同或不同,该设备类型包括:智能手机、智能手表、智能电视、车载移动终端、可穿戴设备、平板电脑、电子书阅读器、MP3播放器、MP4播放 器、膝上型便携计算机中的至少一种。以下实施例以移动终端包括智能手机来举例说明。
本领域技术人员可以知晓,上述移动终端的数量可以更多或更少。比如上述移动终端可以仅为一个,或者上述移动终端为几十个或几百个,或者更多数量。本申请实施例对移动终端的数量和设备类型不加以限定。
为了提高切换锁定目标的效率,图2示出了本申请一个示例性实施例提供的虚拟对象的切换方法的流程图,以该方法应用于图1所示的移动终端120(或移动终端120上的应用程序)进行举例说明,该方法包括:
步骤220,显示处于锁定状态的第一虚拟对象和未处于锁定状态的第二虚拟对象;
锁定状态:锁定状态指示被锁定的虚拟对象成为主控虚拟对象的行为目标。被锁定的虚拟对象之后可能遭受主控虚拟对象发动的攻击,如主控虚拟对象朝被锁定的虚拟对象挥砍、开火、释放投掷物、释放攻击技能等。或者,主控虚拟对象可能朝被锁定的虚拟对象移动,被锁定的虚拟对象所在的位置作为主控虚拟对象的目的地。或者,主控虚拟对象获取被锁定的虚拟对象的详细资料,如在锁定虚拟对象之后,移动终端的屏幕上显示被锁定的虚拟对象的详细介绍“炮兵[等级5]攻击力80防御力50”。在本申请中,锁定状态仅表示被锁定的虚拟对象成为主控虚拟对象的行为目标,本申请并不限制主控虚拟对象对被锁定的虚拟对象的具体行为。
主控虚拟对象:指移动终端具有控制权限的虚拟对象。主控虚拟对象在移动终端的控制下可执行调整身体姿态、行走、奔跑、跳跃、骑行、驾驶、瞄准、拾取、使用投掷类道具、攻击其他虚拟对象中的至少一种行为。主控虚拟对象可以是用户在游戏中控制的虚拟人物对象,也可以是用户在游戏中召唤的虚拟宠物对象,也可以是用户在游戏中使用的虚拟载具对象。
第一虚拟对象:指在虚拟环境中具有活动能力的虚拟对象,可选的,第一虚拟对象是其他用户控制的虚拟对象,或者,第一虚拟对象是NPC(Non-player Character,非玩家角色)。第二虚拟对象也指在虚拟环境中具有活动能力的虚拟对象,第一虚拟对象和第二虚拟对象仅用于区分不同的虚拟对象,即,可能存在第一虚拟对象是其他用户控制的虚拟对象(或NPC),而第二虚拟对象是NPC(或其他用户控制的虚拟对象)的情况;也可能存在第一虚拟对象和第二虚拟对象均是其他用户控制的虚拟对象;或者第一虚拟对象和第二虚拟对象均是NPC的情况。
在众多游戏中可能存在主动锁定和被动锁定两种锁定模式,主动锁定指用户主动控制主控虚拟对象锁定某个虚拟对象,被动锁定指根据预设的锁定规则锁定某个虚拟对象。比如,用户在周围多个虚拟对象中主动选择一个虚拟对象进行攻击,该行为即称为主动锁定;用户控制的主控虚拟对象遭受周围虚拟对象中的某个虚拟对象攻击后,被动地将该虚拟对象作为接下来攻击的目标,即为被动锁定。用户可进行相应的操作在主动锁定和被动锁定中进行切换。
在主动锁定模式下,移动终端的界面上通常会设置有锁定指示器或锁定视觉特效等等用于提示用户当前锁定的虚拟对象。在被动锁定模式下,移动终端的界面通常不额外设置提示信息,根据主控虚拟对象对被锁定的虚拟对象执行具体行为,在界面上可直接观察判断出被锁定的虚拟对象。
在本申请中,主要介绍用户在主动锁定模式下对锁定虚拟对象的切换。
在一个实施例中,移动终端上显示处于锁定状态的第一虚拟对象和未处于锁定状态的第二虚拟对象。示意性的,在移动终端上通过文字、锁定指示器和锁定视觉特效中的至少一种方式表示第一虚拟对象处于锁定状态。例如,在第一虚拟对象的轮廓***添加方框(锁定指示器)指示成功锁定第一虚拟对象,在第一虚拟对象的躯干上显示准星(锁定指示器)指示成功锁定第一虚拟对象,设置第一虚拟对象显示出闪烁特效(锁定视觉特效),设置第一虚拟 对象显示出放大特效(锁定视觉特效),在第一虚拟对象上显示出与第二虚拟对象不同的颜色(锁定视觉特效)等等。
示意性的,图3示出了第一虚拟对象被锁定和第二虚拟对象未被锁定的示意图,第一虚拟对象31上具有锁定指示器301,第二虚拟对象32上不具有锁定指示器301。锁定指示器301指示第一虚拟对象处于锁定状态,对应第二虚拟对象32未处于锁定状态。
步骤240,接收甩动操作;
其中,甩动操作是用于甩动移动终端的机身的操作;响应于用户甩动移动终端的机身,移动终端接收甩动操作。
可选的,移动终端通过内置的运动传感器输出的信号确定接收到甩动操作。示意性的,移动终端通过运动传感器采集的信号变化值确定接收到甩动操作。运动传感器可以是加速度传感器、陀螺仪传感器、对加速度传感器和陀螺仪传感器进行融合后的六轴传感器(或九轴传感器或十二轴传感器)中的至少一种。
可选的,移动终端通过天线接收到的信号确认接收到甩动操作。示意性的,通过接收到的相邻两次信号的幅度变化值和/或频率变化值确认接收到甩动操作,或,通过接收到的相邻两次信号的能量变化值确认接收到甩动操作。响应于用户甩动移动终端,使得天线接收到的相邻两次信号在传输过程中的阻抗不一致,导致相邻两次信号的能量不一致。可选的,天线接收到的信号可能是无线保真wifi信号、移动网络信号、蓝牙信号等等。
可选的,移动终端通过相机采集的图像确认接收到甩动操作。示意性的,通过采集到的相邻两帧图像之间的相似度确认接收到甩动操作。
在一个实施例中,接收甩动操作之前,移动终端的屏幕上还显示第一形态的锁定控件,第一形态的锁定控件用于提示通过甩动操作切换处于锁定状态的虚拟对象。示意性的,图4示出了第一形态的锁定控件401,第一形态的锁定控件401上显示出“甩动手机”的提示图案。在一个实施例中,响应于移动终端界面上先显示预设时长的第一形态的锁定控件,如图4所示,再显示第三形态的锁定控件,如图3所示,图3示出了第三形态的锁定控件302,第三形态的锁定控件302显示出“取消锁定”的文字内容。
步骤260,在甩动操作与第二虚拟对象匹配的情况下,将处于锁定状态的第一虚拟对象切换为第二虚拟对象。
在一个实施例中,移动终端根据运动传感器获取的甩动操作的甩动方向和甩动过程中的最大加速度(甩动加速度),确定与甩动操作匹配的第二虚拟对象。之后,移动终端显示处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象。
其中,移动终端显示处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象的过程可以是:移动终端在根据甩动操作确定出匹配的第二虚拟对象后,将处于锁定状态的第一虚拟对象切换为第二虚拟对象(虚拟对象切换由移动终端执行);可选的,移动终端在根据甩动操作确定出匹配的第二虚拟对象后,将第二虚拟对象上报至服务器,由服务器执行锁定状态的切换,并将切换结果反馈给移动终端,对应移动终端可以根据切换结果显示处于锁定状态的第二虚拟对象和处于未锁定状态的第一虚拟对象。
在一个实施例中,移动终端根据天线接收到的信号的波形产生突变确认接收到甩动操作。根据突变后的波形与突变前的波形的变化情况,确定甩动方向。根据波形突变前后信号的能量变化值,确认甩动操作的甩动幅度。移动终端根据甩动方向和甩动幅度确定第二虚拟对象。
在一个实施例中,移动终端根据相机在甩动操作的启动时刻采集的图像,与,在甩动操作的结束时刻采集的图像,确定甩动操作的甩动方向和甩动幅度,进一步根据甩动方向和甩动幅度可确定第二虚拟对象。移动终端显示处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象。
可选的,移动终端显示处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象,包括以下方式中的至少一种:
·在第二虚拟对象上显示锁定指示器,以及在第一虚拟对象上取消显示锁定指示器;
·在第二虚拟对象上显示锁定视觉特效,以及在第一虚拟对象上取消显示锁定视觉特效;
·显示提示信息,该提示信息用于指示甩动操作的甩动方向;也即显示移动终端在甩动操作的甩动方向的提示信息,提示信息的表现形式包括图形、箭头和文字中的至少一种。
示意性的,图5示出了移动终端将处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象的界面。结合参考图3,可看出,锁定指示器301所在的位置由第一虚拟对象31转移至第二虚拟对象32。图5还示出了等腰三角形501,等腰三角形501的两条腰边长大于第三条边,等腰三角形501用于提示甩动操作的甩动方向,此时甩动方向为左。
综上所述,通过甩动操作实现切换处于锁定状态的虚拟对象,避免了通过多次触控锁定控件进行切换,方便了用户快速切换锁定目标。例如,在用户控制的主控虚拟角色正在与第一敌方角色激烈战斗时,用户发现第二敌方角色出现了短暂的致命破绽,只要主控虚拟角色向其发起攻击即能击败第二敌方角色,通过甩动操作用户将原来锁定的虚拟角色(第一敌方角色)切换为第二敌方角色,并对其发起攻击。因此,设置甩动操作切换锁定目标,不仅丰富了用户的操作方式,还提高了用户切换锁定目标的效率,进而提高了游戏的策略性。
为提高切换锁定目标的效率,图6示出了本申请一个示例性实施例提供的虚拟对象的切换方法的流程图,以该方法应用于图2所示的移动终端120举例说明,该方法包括:
步骤620,显示处于锁定状态的第一虚拟对象和未处于锁定状态的第二虚拟对象;
其中,锁定状态指示被锁定的虚拟对象成为主控虚拟对象的行为目标,主控虚拟对象是移动终端具有控制权限的虚拟对象。在一个实施例中,移动终端上显示处于锁定状态的第一虚拟对象和未处于所述锁定状态的第二虚拟对象。可选的,在移动终端上通过文字、锁定指示器和锁定视觉特效中的至少一种方式表示第一虚拟对象处于锁定状态。
步骤640,通过运动传感器获取甩动操作的甩动方向和甩动加速度;
其中,甩动操作是用于甩动移动终端的机身的操作。
由于甩动操作可能是单次甩动操作,也可能是多次甩动操作,单次甩动操作对应一个甩动方向,多次甩动操作过程中可能存在多个甩动方向,为了避免甩动操作过程中不同甩动方向对最终结果的影响,可以根据移动终端的初始位置和结束位置,确定整个甩动操作过程中的甩动方向。对应在一个实施例中,移动终端通过运动传感器获取移动终端在甩动操作的启动时刻所处的第一位置,之后,通过运动传感器获取移动终端在甩动操作的结束时刻所处的第二位置;基于第一位置和第二位置,确定对移动终端执行的甩动操作的的甩动方向。
示意性的,移动终端通过陀螺仪传感器获取在甩动操作的启动时刻所处的第一位置的坐标为(x
1,y
1,z
1),通过陀螺仪传感器获取在甩动操作的结束时刻所处的第二位置的坐标为(x
2,y
2,z
2),通过坐标向量计算即可确定甩动方向。比如,第一位置坐标为(2,0,0),第二位置坐标为(1,0,0),则甩动方向为左。
可选的,移动终端也可根据加速度传感器,或,加速度传感器和陀螺仪传感器进行融合后的六轴传感器(或九轴传感器或十二轴传感器)确定甩动方向。
示意性的,图7(a)示出了在仅作出单次甩动的情况下,移动终端基于最终位置和初始位置确定甩动方向;图7(b)示出了在作出多次甩动的情况下,移动终端基于最终位置和初始位置确定甩动方向。
为了确定移动终端的甩动方向,就需要确定对移动终端进行甩动操作的启动时刻和结束时刻,而若进行甩动操作移动终端的加速度必然较大,则可以根据运动传感器采集到的加速度数据大小关系确定启动时刻和结束时刻。对应在一个实施例中,移动终端通过运动传感器获取加速度,当加速度由0变大且大于第一阈值时,表示移动终端被甩动,对应移动终端将通过运动传感器获取的加速度大于第一阈值的时刻,确定为甩动操作的启动时刻,之后,移动终端继续通过运动传感器获取加速度,当移动终端判断加速度由大变小,且持续小于第二 阈值时,表示移动终端停止被甩动,对应移动终端将通过运动传感器获取的加速度小于第二阈值的时长达到时长阈值的时刻,确定为甩动操作的结束时刻。
可选的,第一阈值和第二阈值可以相同,比如,第一阈值和第二阈值可以为为0m/s
2;第一阈值和第二阈值可以不同,比如,第一阈值可以为0m/s
2,第二阈值可以为0.2m/s
2。由于甩动操作过程中的加速度数据并非完全相同,而后续仅需要确定出单一锁定的虚拟对象,则默认将甩动操作过程中的最大加速度确定为甩动加速度;对应在一种可能的实施方式中,当移动终端确定出甩动操作的启动时刻和结束时刻后,即可以将启动时刻和结束时刻之间加速度的最大值,确定为甩动操作的甩动加速度。
示意性的,移动终端根据加速度传感器,或,加速度传感器和陀螺仪传感器进行融合后的六轴传感器(或九轴传感器或十二轴传感器)获取加速度。
基于上述,移动终端获取到甩动操作的甩动方向和甩动加速度。
步骤660,基于甩动方向和甩动加速度,确定第二虚拟对象,以及将处于锁定状态的第一虚拟对象切换为第二虚拟对象。
在基于甩动方向和甩动加速度确定第二虚拟对象的过程中,往往需要一个参照物,比如,甩动方向是左边,则第二虚拟对象在参照物的左边;而基于本实施例的切换场景,用户是想要将处于锁定状态的第一虚拟对象切换至其他虚拟对象,则在甩动方向是向左的情况下,表示待切换的虚拟对象应该处于第一虚拟对象的左边。因此在一个实施例中,移动终端在虚拟环境中以第一虚拟对象为基准位置,确定第一虚拟对象的甩动方向上的候选虚拟对象的第一对象数量。该第一对象数量可以用n来表示,n取值可以为正整数。
可选的,第一虚拟对象的甩动方向上可能存在1个或者多个候选虚拟对象,即n的取值可以是1,也可以是3;对应在第一对象数量等于1的情况下(即在n的值等于一的情况下),表示该候选虚拟对象即为待切换的第二虚拟对象,则移动终端可以直接将将甩动方向上的候选虚拟对象确定为第二虚拟对象;可选的,在第一对象数量大于1的情况下(即在n的值大于一的情况下),无法仅根据甩动方向确定出待切换的第二虚拟对象,还需要进一步根据甩动加速度,从多个候选虚拟对象中筛选出第二虚拟对象。对应移动终端基于甩动过程中加速度的最大值(甩动加速度),从甩动方向上存在的n个候选虚拟对象中确定第二虚拟对象。
在一个实施例中,在第一对象数量大于1的情况下(即在n的值大于一的情况下),移动终端可以设置在甩动方向上的n个加速度区间,不同加速度区间对应不同候选虚拟对象所在位置,则存在n个候选虚拟对象,对应设置n个加速度区间;进而根据甩动加速度所处的第i加速度区间,将第i加速度区间对应的候选虚拟对象确定为第二虚拟对象;也就是说,在甩动过程中甩动加速度的最大值处于第i加速度区间的情况下,移动终端确定n个虚拟对象中的第i个候选虚拟对象为第二虚拟对象。其中,n个候选虚拟对象与n个加速度区间一一对应,n个候选虚拟对象按与第一虚拟对象的距离由近到远排序,n个加速度区间按加速度数值由小到大排序。其中,n、i为正整数。
示意性的,运动传感器获取的甩动方向为左,第一虚拟对象的左侧存在两个候选虚拟对象,移动终端设置与左侧对应的两个加速度区间依次为(0,3)、(3,+∞),基于运动传感器获取的甩动操作的甩动加速度的最大值为2,则确定第一虚拟对象的左侧的第1个虚拟对象为第二虚拟对象。
在另一个实施例中,在第一对象数量大于一的情况下(即在n的值大于一的情况下),移动终端获取预设的k个加速度区间,k大于n;之后,确定甩动加速度所处的第j加速度区间,在甩动过程中甩动加速度的最大值处于第j个加速度区间,且j不大于n的情况下,确定n个候选虚拟对象中的第j个候选虚拟对象为第二虚拟对象;在甩动加速度的最大值处于第j个加速度区间(在甩动加速度处于第j加速度区间),且j大于n的情况下,确定n个候选虚拟对象中的第n个候选虚拟对象为第二虚拟对象。其中,n个候选虚拟对象按与第一虚拟对象的距离由近到远排序,k个加速度区间按加速度数值由小到大排序。其中,k、j为正整数。
示意性的,在n的值为3的情况下,移动终端获取预设的8个加速度区间,依次为(0,3)、(3,6)、(6,9)、(9,12)、(12,15)、(15,18)、(18,21)和(21,+∞)。若甩动过程中甩动加速度的最大值为5(落入第2个加速度区间),则确定第一虚拟对象的左侧的第2个候选虚拟对象为第二虚拟对象。若甩动过程中甩动加速度的最大值为14(落入第5个加速度区间),则确定第一虚拟对象的左侧的第3个候选虚拟对象为第二虚拟对象。
可以说明的一点是,上述k个加速度区间可能是基于支持应用程序运行的服务器预先设置得到的,也可能是基于用户在应用程序上设置得到的,比如,用户在应用程序上调节甩动操作的灵敏度,即为调节加速度区间的跨度和/或加速度区间的数量。
基于上述,在虚拟环境中确定出第二虚拟对象。在此之后,移动终端显示处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象,可能的显示方式已在上述步骤260详细说明,此处不再赘述。
综上所述,通过运动传感器接收甩动操作的甩动方向和甩动加速度,根据甩动方向和甩动加速度,确定第二虚拟对象,最终将处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象,提供了根据甩动操作实现切换锁定目标的具体实现方式,保证了切换锁定目标的高效率。
为提高切换锁定目标的效率,图8示出了本申请一个示例性实施例提供的虚拟对象的切换方法的流程图,以该方法应用于图2所示的移动终端120举例说明,该方法包括:
步骤820,显示处于锁定状态的第一虚拟对象和未处于锁定状态的第二虚拟对象;
其中,锁定状态指示被锁定的虚拟对象成为主控虚拟对象的行为目标,主控虚拟对象是移动终端具有控制权限的虚拟对象。在一个实施例中,移动终端上显示处于锁定状态的第一虚拟对象和未处于所述锁定状态的第二虚拟对象。可选的,在移动终端上通过文字、锁定指示器和锁定视觉特效中的至少一种方式表示第一虚拟对象处于锁定状态。
步骤840,通过相机采集的图像确定甩动操作的甩动方向和甩动幅度;
在一个实施例中,移动终端通过相机,获取相机在甩动操作的启动时刻采集的第一图像,以及获取相机在甩动操作的结束时刻采集到的第二图像;之后,基于第一图像和第二图像进行特征点匹配,确定甩动操作的甩动方向。
在一个实施例中,移动终端对通过相机采集到的图像进行特征点追踪,一确定甩动操作的甩动方向。特征点追踪可采用基于视觉里程计的追踪算法,本申请对此不加以限定。可选的,特征点追踪采用KLT(Kanade-Lucas)光流追踪算法。可选的,特征点追踪采用基于ORB(Oriented FAST and Rotated BRIEF,快速特征点提取和描述)算法提取的ORB特征描述子进行特征点跟踪。本申请对特征点追踪的具体算法不加以限定。
在一个实施例中,移动终端通过相机采集图像,并获取相邻两帧图像之间的相似度,所相邻两帧图像之间的相似度较大,则表示移动终端未发生甩动操作;反之,若相邻两帧图像之间的相似度较小,则表示移动终端发生甩动操作;对应移动终端在通过相机获取的第一相邻两帧图像之间的相似度小于第三阈值的情况下,表示开始甩动操作,则将第一相邻两帧图像中的前一帧确定为第一图像,以及将获取第一图像的时刻确定为甩动操作的启动时刻。
示意性的,移动终端在通过相机获取图像之后,会计算相邻两帧图像之间的相似度。相邻两帧图像之间的相似度可以根据特征点进行计算,在相邻两帧图像之间重复出现的特征点的数量小于第一数量阈值的情况下,即认为相邻两帧图像之间的相似度小于第三阈值,此时将相邻两帧图像中的前一帧确定为第一图像;可选的,也可以设置有相似度确定模型,将相邻两帧图像输入相似度确定模型中,可以输出相邻两帧图像之间的相似度,并比较相似度与第三阈值的关系,在相似度小于第三阈值时,将相邻两帧图像的前一帧确定为第一图像,并将第一图像的采集时刻确定为甩动操作的启动时刻。
为了避免相似度计算错误而导致启动时刻确定有误,可选的,移动终端通过相机获取图 像之后,确定相邻两帧图像之间的相似度小于第三阈值,则计数器加1,若在第一预设时长内,移动终端确定另一相邻两帧图像之间的相似度也小于第三阈值,则计数器再次加1,若在第二预设时长内,计数器累加的数值达到预设数值,则确定检测到甩动操作,将最开始达到第三阈值的相邻两帧图像中的前一帧图像确定为第一图像。
在一个实施例中,在移动终端确定出相邻两帧图像之间的相似度较小时,表示移动终端停止被甩动,对应移动终端在通过相机获取的第二相邻两帧图像之间的相似度大于第四阈值的情况下,将第二相邻两帧图像中的后一帧确定为第二图像,以及将获取第二图像的时刻确定为甩动操作的结束时刻;获取第二图像的时刻也即第二图像的采集时刻;
示意性的,移动终端在通过相机获取图像之后,会计算相邻两帧图像之间的相似度。可选的,在相邻两帧图像之间重复出现的特征点的数量大于第二数量阈值的情况下,即认为相邻两帧图像之间的相似度大于第四阈值,此时将相邻两帧图像中的后一帧确定为第二图像。可选的,也可以将相邻两帧图像输入相似度确定模型中,可以输出相邻两帧图像之间的相似度,并比较相似度与第四阈值的关系,在相似度大于第四阈值时,将相邻两帧图像的后一帧确定为第二图像,并将第二图像的采集时刻确定为甩动操作的结束时刻。
可选的,移动终端通过相机获取图像之后,确定相邻两帧图像之间的相似度大于第四阈值,则计数器加1,若在第三预设时长内,移动终端确定另一相邻两帧图像之间的相似度也大于第四阈值,则计数器再次加1,若在第四预设时长内,计数器累加的数值达到第二预设数值,则确定检测到停止甩动,将使得计数器达到第二预设数值的相邻两帧图像中的后一帧图像确定为第二图像。
基于上述,确定得到第一图像和第二图像,即可进一步确定甩动操作的甩动方向和甩动幅度。
可选的,移动终端根据第一图像和第二图像匹配的特征点的位移方向,即可确定甩动操作的甩动方向。可选的,根据第一图像和第二图像之间的相似度,即可映射得到甩动操作的甩动幅度的数值。
可选的,移动终端中可以预先设置有相似度与甩动幅度之间的对应关系,相似度越小,则甩动幅度越大,甩动幅度与相似度呈负相关关系;当移动终端确定出第一图像和第二图像之间的相似度后,即可以根据相似度和甩动幅度之间的对应关系,确定出本次甩动操作对应的甩动幅度。
步骤860,基于甩动方向和甩动幅度,确定第二虚拟对象,以及将处于锁定状态的第一虚拟对象切换为第二虚拟对象。
与上文实施例中基于甩动方向和甩动加速度确定第二虚拟对象类似,在基于甩动方向和甩动幅度确定第二虚拟对象时,也需要以第一虚拟对象为基准位置。在虚拟环境中以第一虚拟对象为基准位置的情况下,移动终端确定以第一虚拟对象为基准位置的甩动方向上的候选虚拟对象的第二对象数量,第二对象数量可以用m表示,m为正整数;在第二对象数量等于一的情况下(也即在m的值等于一的情况下),移动终端可以直接将甩动方向上存在的一个候选虚拟对象确定为第二虚拟对象;在第二对象数量大于一的情况下(也即在m的值大于一的情况下),需要进一步从多个候选虚拟对象中筛选出第二虚拟对象;对应可以基于甩动过程中的甩动幅度,移动终端从甩动方向上存在的m个候选虚拟对象中确定第二虚拟对象。
可选的,在第二对象数量大于一的情况下(在m的值大于一的情况下),移动终端设置与甩动方向对应的m个幅度区间;基于甩动幅度处于第p幅度区间的情况下,移动终端将m个虚拟对象中的第p个虚拟对象确定为第二虚拟对象。其中,m个候选虚拟对象与m个幅度区间一一对应,m个候选虚拟对象按与第一虚拟对象的距离由近到远排序,m个幅度区间按幅度数值由小到大排序。
示意性的,甩动方向为左,第一虚拟对象的左侧存在两个候选虚拟对象,移动终端设置与左侧对应的两个幅度区间依次为(0,3)、(3,+∞),基于相似度获取的甩动幅度的最大值 为2,则确定第一虚拟对象的左侧的第1个候选虚拟对象为第二虚拟对象。
可选的,在第二对象数量大于一的情况下(在m的值大于一的情况下),移动终端获取预设的R个幅度区间,R大于m;之后,在甩动幅度处于第r个幅度区间,且r不大于m的情况下,确定m个候选虚拟对象中的第r个候选虚拟对象为第二虚拟对象;在甩动幅度处于第r个幅度区间,且r大于m的情况下,确定m个候选虚拟对象中的第m个候选虚拟对象为第二虚拟对象。其中,m个候选虚拟对象按与第一虚拟对象的距离由近到远排序,R个幅度区间按幅度数值由小到大排序。
其中,上述m、p、R和r均为正整数。
示意性的,在m的值为3的情况下,移动终端获取预设的8个幅度区间,依次为(0,3)、(3,6)、(6,9)、(9,12)、(12,15)、(15,18)、(18,21)和(21,+∞)。若甩动过程中的甩动幅度为5(落入第2个幅度区间),则确定第一虚拟对象的左侧的第2个候选虚拟对象为第二虚拟对象。若甩动过程中甩动幅度为14(落入第5个加速度区间),则确定第一虚拟对象的左侧的第3个候选虚拟对象为第二虚拟对象。
基于上述,移动终端在虚拟环境中确定出第二虚拟对象。在此之后,移动终端显示处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象,可能的显示方式已在上述步骤260详细说明,此处不再赘述。
综上所述,通过移动终端内置的相机确认接收到甩动操作,根据相机采集到的图像确定甩动操作的甩动方向和甩动幅度,并根据甩动方向和甩动幅度确定第二虚拟对象,最终将处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象,提供了根据甩动操作实现切换锁定目标的具体实现方式,保证了切换锁定目标的高效率。
为提高切换锁定目标的效率,图9是本申请一个示例性实施例提供的虚拟对象的切换方法的流程图,以该方法应用于图1所示的移动终端120进行举例说明,该方法包括:
步骤910,显示第二形态的锁定控件;
在移动终端的界面上,显示第二形态的锁定控件。第二形态的锁定控件用于主控虚拟对象在候选虚拟对象中锁定虚拟对象。结合参考图10(a),图10(a)示出了第二形态的锁定控件1001,示意性的,第二形态的锁定控件1001位于移动终端的界面的右下角区域,方便用户快速执行锁定操作。
步骤920,显示至少两个虚拟对象;
其中,至少两个虚拟对象包括未处于锁定状态的第一虚拟对象。结合参考图10(a),此时图10(a)示出了5个虚拟对象。
步骤930,响应于对第二形态的锁定控件的第一触发操作,确定执行锁定操作;
可选的,第一触发操作包括长按触发、单击触发、双击触发、拖动触发和压力触发中的至少一种。示意性的,响应于图10(a)中的第二形态的锁定控件1001接收到第一触发操作,移动终端确定执行锁定操作。
步骤940,在第一虚拟对象满足锁定条件的情况下,显示处于锁定状态的第一虚拟对象;
在一个实施例中,在第一虚拟对象满足锁定条件的情况下,显示处于锁定状态的第一虚拟对象,包括以下方式中的至少一种:
·在虚拟环境中,确定至少两个虚拟对象中与主控虚拟对象之间的距离最小的虚拟对象为第一虚拟对象,以及显示处于锁定状态的第一虚拟对象。
可选的,移动终端获取各个虚拟对象与主控虚拟对象之间的距离,并将距离最小的虚拟对象确定为第一虚拟对象,并执行对第一虚拟对象的锁定操作,对应显示处于锁定状态的第一虚拟对象。
·在虚拟环境中,确定至少两个虚拟对象中与主控虚拟对象之间的距离小于距离阈值,且落入主控虚拟对象的朝向的虚拟对象为第一虚拟对象,显示处于锁定状态的第一虚拟对象。
可选的,移动终端获取各个虚拟对象与主控虚拟对象之间的距离,并比较各个距离与距离阈值之间的关系,从中筛选出距离小于距离阈值的虚拟对象,进而从中筛选出主控虚拟对象朝向的虚拟对象作为第一虚拟对象,对其执行锁定操作,以显示处于锁定状态的第一虚拟对象。
·在虚拟环境中,确定至少两个虚拟对象中与主控虚拟对象之间的距离小于距离阈值,且绝对生物值最小的虚拟对象为第一虚拟对象,显示处于锁定状态的第一虚拟对象,生物值用于衡量虚拟对象在虚拟环境中的磨损程度,绝对生物值是虚拟对象剩余的生物值。
可选的,移动终端获取各个虚拟对象与主控虚拟对象之间的距离,并比较各个距离与距离阈值之间的关系,首先筛选出距离小于距离阈值的虚拟对象,进而获取该各个虚拟对象的绝对生物值,将绝对生物值最小的虚拟对象确定为第一虚拟对象,以对第一虚拟对象执行锁定操作。
·在虚拟环境中,确定至少两个虚拟对象中与主控虚拟对象之间的距离小于距离阈值,且相对生物值最小的虚拟对象为第一虚拟对象,显示处于锁定状态的第一虚拟对象,相对生物值是虚拟对象剩余的生物值与完整生物值的比值。
可选的,移动终端获取各个虚拟对象与主控虚拟对象之间的距离,并比较各个距离与距离阈值之间的关系,首先筛选出距离小于距离阈值的虚拟对象,进而获取该各个虚拟对象的相对生物值,将相对生物值最小的虚拟对象确定为第一虚拟对象,以对第一虚拟对象执行锁定操作。
相对生物值可以是绝对生物值和完整生物值之间的比值。绝对生物值即虚拟对象的剩余生物值。
结合参考图10,在第一虚拟对象满足锁定条件的情况下,移动终端的显示界面即从图10(a)切换至图10(b),第一虚拟对象31处于锁定状态,对应第一虚拟对象301上显示有锁定指示器301。
步骤950,显示第一形态的锁定控件;
当移动终端接收到对第二形态的锁定控件1001的第一触发操作,在至少两个虚拟对象中锁定第一虚拟对象31,移动终端的显示界面从图10(a)切换至图10(b),结合参考图10(b),第一形态的锁定控件401提示用户可通过甩动操作切换处于锁定状态的虚拟对象。图10(b)还示出了第一虚拟对象31、第二虚拟对象32和锁定指示器301。
步骤960,显示第三形态的锁定控件;
在预设的时长完成显示第一形态的锁定控件之后,移动终端的界面上显示第三形态的锁定控件。第三形态的锁定控件用于取消锁定第一虚拟对象。
示意性的,图10(c)示出了第三形态的锁定控件302。
若移动终端接收到对第三形态的锁定控件302的第二触发操作,移动终端执行取消锁定操作,移动终端中断执行虚拟对象的切换方法。若移动终端未通过第三形态的锁定控件302接收到第二触发操作,执行下述步骤970。
可选的,第二触发操作包括长按触发、单击触发、双击触发、拖动触发和压力触发中的至少一种。
步骤970,显示处于锁定状态的第一虚拟对象和未处于锁定状态的第二虚拟对象;
在一个实施例中,移动终端显示处于锁定状态的第一虚拟对象和未处于锁定状态的第二虚拟对象。可选的,第二虚拟对象属于上述步骤920中至少两个虚拟对象中的一个。
示意性的,图10(c)示出了处于锁定状态的第一虚拟对象31和未处于锁定状态的第二虚拟对象32,此时第二虚拟对象属于上述步骤920中至少两个虚拟对象中的一个。
步骤980,接收甩动操作;
其中,甩动操作是指甩动移动终端的机身的操作。
可选的,移动终端通过内置的运动传感器接收甩动操作,运动传感器包括加速度传感器、 陀螺仪传感器、加速度传感器和陀螺仪传感器进行融合后的六轴传感器(或九轴传感器或十二轴传感器)。
可选的,移动终端通过相机采集的图像确认接收到甩动操作。示意性的,通过采集到的相邻两帧图像之间的相似度确认接收到甩动操作。
可选的,移动终端通过天线接收到的信号确认接收到甩动操作。示意性的,通过接收到的相邻两次信号的能量变化值,移动终端确认接收到甩动操作。
可选的,移动终端可通过其他传感器接收甩动操作。比如,光学传感器,通过甩动操作导致的光线强度变化情况,可确认接收到甩动操作。也可能通过温度感应器、磁场感应器等接收甩动操作。
步骤990,在甩动操作与第二虚拟对象匹配的情况下,将处于锁定状态的第一虚拟对象切换为第二虚拟对象。
在一个实施例中,移动终端根据运动传感器获取的甩动操作的甩动方向和甩动过程中的最大加速度,确定与甩动操作匹配的第二虚拟对象。之后,移动终端显示处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象。
在一个实施例中,移动终端根据天线接收到的信号的波形产生突变确认接收到甩动操作。根据突变后的波形与突变前的波形的变化情况,确定甩动方向。根据波形突变前后信号的能量变化值,确认甩动操作的甩动幅度。移动终端根据甩动方向和甩动幅度确定第二虚拟对象。之后,移动终端显示处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象。
在一个实施例中,移动终端根据相机在甩动操作的启动时刻采集的图像,与,在甩动操作的结束时刻采集的图像,确定甩动操作的甩动方向和甩动幅度,进一步根据甩动方向和甩动幅度可确定第二虚拟对象。之后,移动终端显示处于锁定状态的虚拟对象由第一虚拟对象切换为第二虚拟对象。
示意性的,图10(d)示出了处于锁定状态的第二虚拟对象32,锁定状态由第一虚拟对象31切换至第二虚拟对象32,第一虚拟对象31上未显示锁定指示器。可以注意到的是,图10(d)还示出了甩动方向的提示图形501。
值得说明的一点是,在执行步骤970至步骤990的过程中,或执行步骤990之后,可能响应于第三形态的锁定控件接收到第二触发操作,移动终端执行取消锁定操作。在执行取消锁定操作之后,移动终端即停止切换锁定目标。
综上所述,通过在移动终端的界面上设置有第一形态的锁定控件(甩动操作的提示信息)、第二形态的锁定控件(可执行锁定操作)和第三形态的锁定控件(可执行取消锁定操作),并设置有甩动方向的提示信息,完善了虚拟对象的切换方法的具体实现方式,使得该切换方法更贴近用户的操作习惯。
为提高切换锁定目标的效率,图11示出了本申请一个示例性实施例提供的虚拟对象的切换方法的流程图,以该方法应用于智能手机进行举例说明,该方法包括:
步骤1101,开始;
手机开始执行锁定目标的切换流程。
步骤1102,判断用户是否在主界面点击了目标锁定按钮;
手机判断用户是否在主界面点击了目标锁定按钮。目标锁定按钮是用于主动锁定主界面上的目标人物的按钮。在手机运行应用程序时,在手机屏幕的右下角设置有目标锁定按钮。在常规情况下,若距离玩家角色一定范围内不存在可锁定的目标,则用户对目标锁定按钮的触发操作不起作用。若在距离玩家角色一定范围内存在可锁定的目标,则用户对目标锁定按钮的触发操作触发锁定。
若用户在主界面点击了目标锁定按钮,执行步骤1104;若用户未在主界面点击了目标锁定按钮,执行步骤1103。
步骤1103,不执行目标锁定切换;
若手机未接收到目标锁定按钮的触发操作,则手机不执行目标锁定切换。可选的,触发操作包括长按触发、单击触发、双击触发、拖动触发和压力触发,等等。
步骤1104,判断视野范围内是否有可以锁定的目标;
若手机接收到用户对目标锁定按钮的触发操作,手机判断玩家角色的视野范围内是否有可以锁定的目标。若存在可以锁定的目标,执行步骤1106;若不存在可以锁定的目标,则执行步骤1105。
步骤1105,不执行目标锁定;
手机确定玩家角色的视野范围内不存在可以锁定的目标,手机不执行目标锁定,即手机不在玩家角色的视野范围内锁定虚拟对象。
步骤1106,当前符合锁定状态的目标数量大于1;
手机判断玩家角色的视野范围内符合锁定状态的目标数量是否大于1。若符合锁定状态的目标数量大于1,则手机将会启动根据甩动操作切换锁定目标的线程,即,之后手机将执行步骤1108。若符合锁定状态的目标数量等于1,则手机判断当前无法切换锁定目标,即手机不启动根据甩动操作切换锁定目标的线程,即,之后手机将启动步骤1107。
步骤1107,不启动加速度传感器;
手机不启动加速度传感器。
步骤1108,启动加速度传感器;
基于当前符合锁定状态的目标数量大于1,手机启动加速度传感器。加速度传感器可用于确定之后甩动操作的甩动方向和甩动加速度。
步骤1109,手机是否发生甩动操作;
手机判断是否接收到甩动操作,若是则进一步判断甩动操作的甩动方向。若否则,执行步骤1110。
步骤1110,不执行目标锁定;
手机确认未接收到甩动操作,则不执行目标锁定。
步骤1111,甩动后的位置较甩动前的位置向上;
手机确认发生甩动操作后,手机确认甩动后的位置较甩动前的位置向上(甩动方向向上)。
步骤1112,甩动后的位置较甩动前的位置向左;
手机确认发生甩动操作后,手机确认甩动后的位置较甩动前的位置向左(甩动方向向左)。
步骤1113,甩动后的位置较甩动前的位置向右;
手机确认发生甩动操作后,手机确认甩动后的位置较甩动前的位置向右(甩动方向向右)。
步骤1114,甩动后的位置较甩动前的位置向下;
手机确认发生甩动操作后,手机确认甩动后的位置较甩动前的位置向下(甩动方向向下)。
步骤1115,获取手机的甩动加速度值;
手机获取甩动加速度值。可选的,手机通过加速度传感器获取甩动过程中甩动加速度的最大值。
步骤1116,确定甩动加速度所处的加速度动态区域;
手机确定甩动加速度所处的加速度动态区域,根据加速度动态区域确定切换后的锁定目标。可选的,手机根据甩动过程中甩动加速度的最大值,确定与所述甩动加速度的最大值匹配的加速度动态区域。可选的,手机事先预设有一定数量的加速度动态区域,或,手机根据虚拟环境中玩家角色的甩动方向上存在的虚拟对象数量,设置相同数量的加速度动态区域。
步骤1117,锁定目标向后切换;
在甩动后的位置较甩动前的位置向上的情况下,手机控制锁定目标向后切换。
步骤1118,锁定目标向左切换;
在甩动后的位置较甩动前的位置向左的情况下,手机控制锁定目标向左切换。
步骤1119,锁定目标向右切换;
在甩动后的位置较甩动前的位置向右的情况下,手机控制锁定目标向右切换。
步骤1120,锁定目标向前切换;
在甩动后的位置较甩动前的位置向下的情况下,手机控制锁定目标向前切换。
步骤1121,用户是否点击取消锁定按钮;
手机判断用户是否点击了取消锁定按钮。若用户点击了取消锁定按钮,则手机停止虚拟对象的切换,并关闭应用程序的锁定逻辑,退出锁定进程。
若用户点击了取消锁定按钮,则执行步骤1122。
步骤1122,关闭加速度感应器;
手机退出锁定进程,并关闭加速度感应器。
图12是本申请一个示例性实施例提供的虚拟对象的切换装置的结构框图,该装置包括:
显示模块1201,用于显示处于锁定状态的第一虚拟对象和未处于锁定状态的第二虚拟对象,锁定状态指示被锁定的虚拟对象成为主控虚拟对象的行为目标;
接收模块1202,用于接收甩动操作,甩动操作是用于甩动移动终端的机身的操作;
切换模块1203,还用于在甩动操作与第二虚拟对象匹配的情况下,将处于锁定状态的第一虚拟对象切换为第二虚拟对象。
在一个可选的实施例中,显示模块1201,还用于在第二虚拟对象上显示锁定指示器,以及在第一虚拟对象上取消显示锁定指示器。
在一个可选的实施例中,显示模块1201,还用于在第二虚拟对象上显示锁定视觉特效,以及在第一虚拟对象上取消显示锁定视觉特效。
在一个可选的实施例中,显示模块1201,还用于显示提示信息,所述提示信息用于指示甩动操作的甩动方向,提示信息的表现形式包括图形、箭头和文字中的至少一种。
在一个可选的实施例中,接收模块1202,还用于通过运动传感器获取甩动操作的甩动方向和甩动加速度,甩动加速度是甩动操作过程中的最大加速度。
在一个可选的实施例中,切换模块1203,还用于基于甩动方向和甩动加速度,确定第二虚拟对象,以及将处于锁定状态的第一虚拟对象切换为第二虚拟对象。
在一个可选的实施例中,切换模块1203,还用于:
在虚拟环境中以第一虚拟对象为基准位置的情况下,确定甩动方向上的候选虚拟对象的第一对象数量。
在第一对象数量等于一的情况下,将甩动方向上的候选虚拟对象确定为第二虚拟对象。
在第一对象数量大于一的情况下,基于甩动加速度,从甩动方向上的候选虚拟对象中确定第二虚拟对象。
在一个可选的实施例中,切换模块1203,还用于:
在第一对象数量大于一的情况下,设置在甩动方向上的n个加速度区间,不同加速度区间对应不同候选虚拟对象所在位置。
基于甩动加速度所处的第i加速度区间,将第i加速度区间上的候选虚拟对象确定为第二虚拟对象。
其中,i为正整数,候选虚拟对象按与第一虚拟对象的距离由近到远排序,n个加速度区间按加速度数值由小到大排序。
在一个可选的实施例中,切换模块1203,还用于:
在第一对象数量大于一的情况下,获取预设的k个加速度区间,k大于第一对象数量。
在甩动加速度处于第j个加速度区间,且j不大于第一对象数量的情况下,将候选虚拟对象中的第j个候选虚拟对象确定为第二虚拟对象。
在甩动加速度处于第j个加速度区间,且j大于第一对象数量的情况下,将候选虚拟对象 中的第n个候选虚拟对象为第二虚拟对象,n等于第一对象数量。
其中,k、j为正整数,候选虚拟对象按与第一虚拟对象的距离由近到远排序,k个加速度区间按加速度数值由小到大排序。
在一个可选的实施例中,接收模块1202,还用于:
通过运动传感器获取移动终端所处的第一位置,第一位置是移动终端在甩动操作的启动时刻所处的位置。
通过运动传感器获取移动终端所处的第二位置,第二位置是移动终端在甩动操作的结束时刻所处的位置。
基于第一位置和第二位置,确定甩动操作的甩动方向。
在一个可选的实施例中,接收模块1202,还用于:
将通过运动传感器获取的加速度大于第一阈值的时刻,确定为甩动操作的启动时刻。
将通过运动传感器获取的加速度小于第二阈值的时长达到时长阈值的时刻,确定为甩动操作的结束时刻。
将启动时刻和结束时刻之间加速度的最大值,确定为甩动加速度。
在一个可选的实施例中,接收模块1202,还用于通过相机采集的图像确定甩动操作的甩动方向和甩动幅度。
在一个可选的实施例中,切换模块1203,还用于基于甩动方向和甩动幅度,确定第二虚拟对象,以及将处于锁定状态的第一虚拟对象切换为第二虚拟对象。
在一个可选的实施例中,切换模块1203,还用于:
在虚拟环境中以所述第一虚拟对象为基准位置的情况下,确定甩动方向上的候选虚拟对象的第二对象数量。
在第二对象数量等于一的情况下,将甩动方向上的候选虚拟对象确定为第二虚拟对象。
在第二对象数量大于一的情况下,基于甩动幅度,从甩动方向上的候选虚拟对象中确定第二虚拟对象。
在一个可选的实施例中,接收模块1202,还用于:
获取相机采集到的第一图像,第一图像由相机在甩动操作的启动时刻采集得到。
获取相机采集到的第二图像,第二图像由相机在甩动操作的结束时刻采集得到。
基于第一图像和第二图像进行特征点匹配,确定甩动操作的甩动方向。
在一个可选的实施例中,接收模块1202,还用于:
在通过相机获取的第一相邻两帧图像之间的相似度小于第三阈值的情况下,将第一相邻两帧图像中的前一帧确定为第一图像;
在通过相机获取的第二相邻两帧图像之间的相似度大于第四阈值的情况下,将第二相邻两帧图像中的后一帧确定为第二图像;
基于第一图像与第二图像之间的相似度,确定甩动操作的甩动幅度。
在一个可选的实施例中,显示模块1201,还用于显示第一形态的锁定控件,第一形态的锁定控件用于提示通过甩动操作切换处于锁定状态的虚拟对象。
在一个可选的实施例中,显示模块1201,还用于显示至少两个虚拟对象,至少两个虚拟对象包括未处于锁定状态的第一虚拟对象。
在一个可选的实施例中,显示模块1201,还用于在第一虚拟对象满足锁定条件的情况下,显示处于锁定状态的第一虚拟对象。
在一个可选的实施例中,显示模块1201,还用于:
确定至少两个虚拟对象中与主控虚拟对象之间的距离最小的虚拟对象为第一虚拟对象,以及显示处于锁定状态的第一虚拟对象。
确定至少两个虚拟对象中与主控虚拟对象之间的距离小于距离阈值,且落入主控虚拟对象的朝向的虚拟对象为第一虚拟对象,以及显示处于锁定状态的第一虚拟对象。
确定至少两个虚拟对象中与主控虚拟对象之间的距离小于距离阈值,且绝对生物值最小的虚拟对象为第一虚拟对象,以及显示处于锁定状态的第一虚拟对象,绝对生物值是虚拟对象剩余的生物值,所述生物值用于衡量虚拟对象在所述虚拟环境中的磨损程度。
确定至少两个虚拟对象中与主控虚拟对象之间的距离小于距离阈值,且相对生物值最小的虚拟对象为第一虚拟对象,以及显示处于锁定状态的第一虚拟对象,相对生物值是虚拟对象剩下的生物值与完整生物值的比值。
在一个可选的实施例中,显示模块1201,还用于显示第二形态的锁定控件。
在一个可选的实施例中,显示模块1201,还用于响应于对第二形态的锁定控件的第一触发操作,确定执行锁定操作。
在一个可选的实施例中,显示模块1201,还用于显示第三形态的锁定控件。
在一个可选的实施例中,显示模块1201,还用于响应于对第三形态的锁定控件的第二触发操作,确定执行取消锁定操作。
综上所述,上述装置通过甩动操作实现切换处于锁定状态的虚拟对象,避免了通过多次触控锁定控件进行切换,方便了用户快速切换锁定目标。例如,在用户控制的主控虚拟角色正在与第一敌方角色激烈战斗时,用户发现第二敌方角色出现了短暂的致命破绽,只要主控虚拟角色向其发起攻击即能击败第二敌方角色,通过甩动操作用户将原来锁定的虚拟角色(第一敌方角色)切换为第二敌方角色,并对其发起攻击。因此,设置甩动操作切换锁定目标,不仅丰富了用户的操作方式,还提高了用户切换锁定目标的效率,进而提高了游戏的策略性。
图13示出了本申请一个示例性实施例提供的计算机设备1300的结构框图。该计算机设备1300可以是便携式移动终端,比如:智能手机、平板电脑、MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3)、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、笔记本电脑或台式电脑。计算机设备1300还可能被称为用户设备、便携式终端、膝上型终端、台式终端等其他名称。
通常,计算机设备1300包括有:处理器1301和存储器1302。
处理器1301可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器1301可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器1301也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central Processing Unit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器1301可以集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器1301还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。
存储器1302可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器1302还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器1302中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器1301所执行以实现本申请中方法实施例提供的虚拟对象的切换方法。
在一些实施例中,计算机设备1300还可选包括有:***设备接口1303和至少一个***设备。处理器1301、存储器1302和***设备接口1303之间可以通过总线或信号线相连。各个***设备可以通过总线、信号线或电路板与***设备接口1303相连。示例地,***设备可以包括:显示屏1304和摄像头组件1305。
在一些实施例中,计算机设备1300还包括有一个或多个传感器1306。该一个或多个传 感器1306包括但不限于:加速度传感器、陀螺仪传感器、压力传感器、光学传感器以及接近传感器。
本领域技术人员可以理解,图13中示出的结构并不构成对计算机设备1300的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。
本申请还提供一种计算机可读存储介质,所述存储介质中存储有至少一段程序,所述至少一段程序由处理器加载并执行以实现上述方法实施例提供的虚拟对象的切换方法。
本申请提供了一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述方法实施例提供的虚拟对象的切换方法。
Claims (21)
- 一种虚拟对象的切换方法,所述方法由移动终端执行,所述方法包括:显示处于锁定状态的第一虚拟对象和未处于所述锁定状态的第二虚拟对象,所述锁定状态指示被锁定的虚拟对象成为主控虚拟对象的行为目标;接收甩动操作,所述甩动操作是用于甩动所述移动终端的机身的操作;在所述甩动操作与所述第二虚拟对象匹配的情况下,将处于所述锁定状态的所述第一虚拟对象切换为所述第二虚拟对象。
- 根据权利要求1所述的方法,其中,所述将处于所述锁定状态的所述第一虚拟对象切换为所述第二虚拟对象,包括以下方式中的至少一种:在所述第二虚拟对象上显示锁定指示器,以及在所述第一虚拟对象上取消显示所述锁定指示器;在所述第二虚拟对象上显示锁定视觉特效,以及在所述第一虚拟对象上取消显示所述锁定视觉特效;以及,显示提示信息,所述提示信息用于指示所述甩动操作的甩动方向,所述提示信息的表现形式包括图形、箭头和文字中的至少一种。
- 根据权利要求2所述的方法,其中,所述接收甩动操作,包括:通过运动传感器获取所述甩动操作的所述甩动方向和甩动加速度,所述甩动加速度是所述甩动操作过程中的最大加速度;所述在所述甩动操作与所述第二虚拟对象匹配的情况下,将处于所述锁定状态的所述第一虚拟对象切换为所述第二虚拟对象,包括:基于所述甩动方向和所述甩动加速度,确定所述第二虚拟对象,以及将处于所述锁定状态的所述第一虚拟对象切换为所述第二虚拟对象。
- 根据权利要求3所述的方法,其中,所述基于所述甩动方向和所述甩动加速度,确定所述第二虚拟对象,包括:在虚拟环境中以所述第一虚拟对象为基准位置的情况下,确定所述甩动方向上的候选虚拟对象的第一对象数量;在所述第一对象数量等于一的情况下,将所述甩动方向上的所述候选虚拟对象确定为所述第二虚拟对象;在所述第一对象数量大于一的情况下,基于所述甩动加速度,从所述甩动方向上的所述候选虚拟对象中确定所述第二虚拟对象。
- 根据权利要求4所述的方法,其中,所述在所述第一对象数量大于一的情况下,基于所述甩动加速度,从所述甩动方向上的所述候选虚拟对象中确定所述第二虚拟对象,包括:在所述第一对象数量大于一的情况下,设置在所述甩动方向上的n个加速度区间,不同加速度区间对应不同候选虚拟对象所在位置;基于所述甩动加速度所处的第i加速度区间,将所述第i加速度区间上的候选虚拟对象确定为所述第二虚拟对象;其中,i为正整数,所述候选虚拟对象按与所述第一虚拟对象的距离由近到远排序,所述n个加速度区间按加速度数值由小到大排序。
- 根据权利要求4所述的方法,其中,所述在所述第一对象数量大于一的情况下,基于所述甩动加速度,从所述甩动方向上的所述候选虚拟对象中确定所述第二虚拟对象,包括:在所述第一对象数量大于一的情况下,获取预设的k个加速度区间,k大于所述第一对象数量;在所述甩动加速度处于第j个加速度区间,且j不大于所述第一对象数量的情况下,将所述候选虚拟对象中的第j个候选虚拟对象确定为所述第二虚拟对象;在所述甩动加速度处于所述第j个加速度区间,且j大于所述第一对象数量的情况下,将所述候选虚拟对象中的第n个候选虚拟对象确定为所述第二虚拟对象,n等于所述第一对象数量;其中,k、j为正整数,所述候选虚拟对象按与所述第一虚拟对象的距离由近到远排序,所述k个加速度区间按加速度数值由小到大排序。
- 根据权利要求3至6任一所述的方法,其中,所述通过运动传感器获取所述甩动操作的所述甩动方向,包括:通过所述运动传感器获取所述移动终端所处的第一位置,所述第一位置是所述移动终端在所述甩动操作的启动时刻所处的位置;通过所述运动传感器获取所述移动终端所处的第二位置,所述第二位置是所述移动终端在所述甩动操作的结束时刻所处的位置;基于所述第一位置和所述第二位置,确定所述甩动操作的所述甩动方向。
- 根据权利要求3至6任一所述的方法,其中,所述通过运动传感器获取所述甩动操作的甩动加速度,包括:将通过所述运动传感器获取的加速度大于第一阈值的时刻,确定为所述甩动操作的启动时刻;将通过所述运动传感器获取的加速度小于第二阈值的时长达到时长阈值的时刻,确定为所述甩动操作的结束时刻;将所述启动时刻和所述结束时刻之间加速度的最大值,确定为所述甩动加速度。
- 根据权利要求2所述的方法,其中,所述接收甩动操作,包括:通过相机采集的图像确定所述甩动操作的所述甩动方向和甩动幅度;所述在所述甩动操作与所述第二虚拟对象匹配的情况下,将处于所述锁定状态的所述第一虚拟对象切换为所述第二虚拟对象,包括:基于所述甩动方向和所述甩动幅度,确定所述第二虚拟对象,以及将处于所述锁定状态的所述第一虚拟对象切换为所述第二虚拟对象。
- 根据权利要求9所述的方法,其中,所述基于所述甩动方向和所述甩动幅度,确定所述第二虚拟对象,包括:在虚拟环境中以所述第一虚拟对象为基准位置的情况下,确定所述甩动方向上的候选虚拟对象的第二对象数量;在所述第二对象数量等于一的情况下,将所述甩动方向上的所述候选虚拟对象确定为所述第二虚拟对象;在所述第二对象数量大于一的情况下,基于所述甩动幅度,从所述甩动方向上的所述候选虚拟对象中确定所述第二虚拟对象。
- 根据权利要求9所述的方法,其中,所述通过相机采集的图像确定所述甩动操作的所述甩动方向,包括:获取所述相机采集到的第一图像,所述第一图像由所述相机在所述甩动操作的启动时刻采集得到;获取所述相机采集到的第二图像,所述第二图像由所述相机在所述甩动操作的结束时刻采集得到;基于所述第一图像和所述第二图像进行特征点匹配,确定所述甩动操作的所述甩动方向。
- 根据权利要求9所述的方法,其中,所述通过相机采集的图像确定所述甩动操作的甩动幅度,包括:在通过所述相机获取的第一相邻两帧图像之间的相似度小于第三阈值的情况下,将所述第一相邻两帧图像中的前一帧确定为第一图像;在通过所述相机获取的第二相邻两帧图像之间的相似度大于第四阈值的情况下,将所述 第二相邻两帧图像中的后一帧确定为第二图像;基于所述第一图像与所述第二图像之间的相似度,确定所述甩动操作的所述甩动幅度。
- 根据权利要求1至6任一所述的方法,其中,所述方法还包括:显示第一形态的锁定控件,所述第一形态的锁定控件用于提示通过所述甩动操作切换处于所述锁定状态的虚拟对象。
- 根据权利要求1至6任一所述的方法,其中,所述方法还包括:显示至少两个虚拟对象,所述至少两个虚拟对象包括未处于所述锁定状态的第一虚拟对象;在所述第一虚拟对象满足锁定条件的情况下,显示处于所述锁定状态的所述第一虚拟对象。
- 根据权利要求14所述的方法,其中,所述在所述第一虚拟对象满足锁定条件的情况下,显示处于所述锁定状态的所述第一虚拟对象,包括以下方式中的至少一种:确定所述至少两个虚拟对象中与所述主控虚拟对象之间的距离最小的虚拟对象为所述第一虚拟对象,以及显示处于所述锁定状态的所述第一虚拟对象;确定所述至少两个虚拟对象中与所述主控虚拟对象之间的距离小于距离阈值,且落入所述主控虚拟对象的朝向的虚拟对象为所述第一虚拟对象,以及显示处于所述锁定状态的所述第一虚拟对象;确定所述至少两个虚拟对象中与所述主控虚拟对象之间的距离小于所述距离阈值,且绝对生物值最小的虚拟对象为所述第一虚拟对象,以及显示处于所述锁定状态的所述第一虚拟对象,所述绝对生物值是所述虚拟对象剩余的生物值,所述生物值用于衡量所述虚拟对象在所述虚拟环境中的磨损程度;确定所述至少两个虚拟对象中与所述主控虚拟对象之间的距离小于所述距离阈值,且相对生物值最小的虚拟对象为所述第一虚拟对象,以及显示处于所述锁定状态的所述第一虚拟对象,所述相对生物值是所述虚拟对象剩余的生物值与完整生物值的比值。
- 根据权利要求14所述的方法,其中,所述方法还包括:显示第二形态的锁定控件;响应于对所述第二形态的锁定控件的第一触发操作,确定执行锁定操作。
- 根据权利要求1至6任一所述的方法,其中,所述方法还包括:显示第三形态的锁定控件;响应于对所述第三形态的锁定控件的第二触发操作,确定执行取消锁定操作。
- 一种虚拟对象的切换装置,所述装置包括:显示模块,用于显示处于锁定状态的第一虚拟对象和未处于所述锁定状态的第二虚拟对象,所述锁定状态指示被锁定的虚拟对象成为主控虚拟对象的行为目标;接收模块,用于接收甩动操作,所述甩动操作是用于甩动所述装置的操作;切换模块,用于在所述甩动操作与所述第二虚拟对象匹配的情况下,将处于所述锁定状态的所述第一虚拟对象切换为所述第二虚拟对象。
- 一种计算机设备,所述计算机设备包括:处理器和存储器,所述存储器存储有计算机程序,所述计算机程序由所述处理器加载并执行以实现如权利要求1至17任一所述的虚拟对象的切换方法。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序由处理器加载并执行以实现如权利要求1至17任一所述的虚拟对象的切换方法。
- 一种计算机程序产品,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中,计算机设备的处理器从所述计算机可读存储介质读取所述计算机指令,所述处理器执行所述计算机指令,使得所述计算机设备执行以实现如权利要求1至17任一所述的虚拟对象的切换方法。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US18/352,607 US20230356075A1 (en) | 2021-12-10 | 2023-07-14 | Method, computer device, and storage medium for virtual object switching |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111506115.4A CN114130023A (zh) | 2021-12-10 | 2021-12-10 | 虚拟对象的切换方法、装置、设备、介质及程序产品 |
CN202111506115.4 | 2021-12-10 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US18/352,607 Continuation US20230356075A1 (en) | 2021-12-10 | 2023-07-14 | Method, computer device, and storage medium for virtual object switching |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023103615A1 true WO2023103615A1 (zh) | 2023-06-15 |
Family
ID=80386169
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/127014 WO2023103615A1 (zh) | 2021-12-10 | 2022-10-24 | 虚拟对象的切换方法、装置、设备、介质及程序产品 |
Country Status (3)
Country | Link |
---|---|
US (1) | US20230356075A1 (zh) |
CN (1) | CN114130023A (zh) |
WO (1) | WO2023103615A1 (zh) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114130023A (zh) * | 2021-12-10 | 2022-03-04 | 腾讯科技(深圳)有限公司 | 虚拟对象的切换方法、装置、设备、介质及程序产品 |
CN114949842A (zh) * | 2022-06-15 | 2022-08-30 | 网易(杭州)网络有限公司 | 虚拟对象的切换方法及装置、存储介质、电子设备 |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090325660A1 (en) * | 2008-06-27 | 2009-12-31 | Microsoft Corporation | Targeting control in a simulated environment |
US20100273544A1 (en) * | 2009-04-22 | 2010-10-28 | Namco Bandai Games Inc. | Information storage medium, game device, and method of controlling game device |
CN105302434A (zh) * | 2015-06-16 | 2016-02-03 | 深圳市腾讯计算机***有限公司 | 游戏场景中锁定目标的方法和装置 |
CN108144293A (zh) * | 2017-12-15 | 2018-06-12 | 网易(杭州)网络有限公司 | 信息处理方法、装置、电子设备及存储介质 |
CN110420462A (zh) * | 2018-10-25 | 2019-11-08 | 网易(杭州)网络有限公司 | 游戏中虚拟对象锁定的方法及装置、电子设备、存储介质 |
CN111338487A (zh) * | 2020-02-13 | 2020-06-26 | 腾讯科技(深圳)有限公司 | 虚拟环境中的特征切换方法、装置、终端及可读存储介质 |
CN112402977A (zh) * | 2020-11-24 | 2021-02-26 | 网易(杭州)网络有限公司 | 目标虚拟角色的锁定方法、装置、处理器及电子装置 |
CN114130023A (zh) * | 2021-12-10 | 2022-03-04 | 腾讯科技(深圳)有限公司 | 虚拟对象的切换方法、装置、设备、介质及程序产品 |
-
2021
- 2021-12-10 CN CN202111506115.4A patent/CN114130023A/zh active Pending
-
2022
- 2022-10-24 WO PCT/CN2022/127014 patent/WO2023103615A1/zh unknown
-
2023
- 2023-07-14 US US18/352,607 patent/US20230356075A1/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090325660A1 (en) * | 2008-06-27 | 2009-12-31 | Microsoft Corporation | Targeting control in a simulated environment |
US20100273544A1 (en) * | 2009-04-22 | 2010-10-28 | Namco Bandai Games Inc. | Information storage medium, game device, and method of controlling game device |
CN105302434A (zh) * | 2015-06-16 | 2016-02-03 | 深圳市腾讯计算机***有限公司 | 游戏场景中锁定目标的方法和装置 |
CN108144293A (zh) * | 2017-12-15 | 2018-06-12 | 网易(杭州)网络有限公司 | 信息处理方法、装置、电子设备及存储介质 |
CN110420462A (zh) * | 2018-10-25 | 2019-11-08 | 网易(杭州)网络有限公司 | 游戏中虚拟对象锁定的方法及装置、电子设备、存储介质 |
CN111338487A (zh) * | 2020-02-13 | 2020-06-26 | 腾讯科技(深圳)有限公司 | 虚拟环境中的特征切换方法、装置、终端及可读存储介质 |
CN112402977A (zh) * | 2020-11-24 | 2021-02-26 | 网易(杭州)网络有限公司 | 目标虚拟角色的锁定方法、装置、处理器及电子装置 |
CN114130023A (zh) * | 2021-12-10 | 2022-03-04 | 腾讯科技(深圳)有限公司 | 虚拟对象的切换方法、装置、设备、介质及程序产品 |
Also Published As
Publication number | Publication date |
---|---|
US20230356075A1 (en) | 2023-11-09 |
CN114130023A (zh) | 2022-03-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109126129B (zh) | 在虚拟环境中对虚拟物品进行拾取的方法、装置及终端 | |
WO2019153750A1 (zh) | 用于对虚拟环境进行视角切换的方法、装置、设备及存储介质 | |
CN109529319B (zh) | 界面控件的显示方法、设备及存储介质 | |
US12036474B2 (en) | Virtual object control method and apparatus, device, and readable storage medium | |
CN111035918B (zh) | 基于虚拟环境的侦察界面显示方法、装置及可读存储介质 | |
WO2023103615A1 (zh) | 虚拟对象的切换方法、装置、设备、介质及程序产品 | |
JP2022500224A (ja) | ユーザインターフェース表示方法、ユーザインターフェース表示装置、端末、コンピュータ装置、およびプログラム | |
WO2019153836A1 (zh) | 虚拟环境中虚拟对象的姿态确定方法、装置及介质 | |
CN110141859B (zh) | 虚拟对象控制方法、装置、终端及存储介质 | |
US20230033874A1 (en) | Virtual object control method and apparatus, terminal, and storage medium | |
CN111399639B (zh) | 虚拟环境中运动状态的控制方法、装置、设备及可读介质 | |
CN113426124B (zh) | 游戏中的显示控制方法、装置、存储介质及计算机设备 | |
CN110478900B (zh) | 虚拟环境中的地图区域生成方法、装置、设备及存储介质 | |
CN113041620B (zh) | 显示位置标记的方法、装置、设备及存储介质 | |
CN112843679A (zh) | 虚拟对象的技能释放方法、装置、设备及介质 | |
US20230321541A1 (en) | Displaying visual field picture based on interaction zone on a virtual map | |
US20230082928A1 (en) | Virtual aiming control | |
US20210117070A1 (en) | Computer-readable recording medium, computer apparatus, and method of controlling | |
JP2022524802A (ja) | 仮想環境におけるスコープの適用方法及び装置並びにコンピュータ装置及びプログラム | |
WO2022257690A1 (zh) | 在虚拟环境中标记物品的方法、装置、设备及存储介质 | |
CN111330278B (zh) | 基于虚拟环境的动画播放方法、装置、设备及介质 | |
US20220291791A1 (en) | Method and apparatus for determining selected target, device, and storage medium | |
CN110448907B (zh) | 虚拟环境中虚拟元素的显示方法、装置及可读存储介质 | |
CN113134232B (zh) | 虚拟对象的控制方法、装置、设备及计算机可读存储介质 | |
WO2023071808A1 (zh) | 基于虚拟场景的图形显示方法、装置、设备以及介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22903039 Country of ref document: EP Kind code of ref document: A1 |