CN111957038A - Method and device for controlling virtual object - Google Patents

Method and device for controlling virtual object Download PDF

Info

Publication number
CN111957038A
CN111957038A CN202010755188.6A CN202010755188A CN111957038A CN 111957038 A CN111957038 A CN 111957038A CN 202010755188 A CN202010755188 A CN 202010755188A CN 111957038 A CN111957038 A CN 111957038A
Authority
CN
China
Prior art keywords
virtual object
speed
control equipment
product model
physical key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010755188.6A
Other languages
Chinese (zh)
Inventor
宋昊明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shipan Technology Beijing Co ltd
Original Assignee
Shipan Technology Beijing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shipan Technology Beijing Co ltd filed Critical Shipan Technology Beijing Co ltd
Priority to CN202010755188.6A priority Critical patent/CN111957038A/en
Publication of CN111957038A publication Critical patent/CN111957038A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/40Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
    • A63F13/42Processing 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
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/24Constructional details thereof, e.g. game controllers with detachable joystick handles
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/40Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
    • A63F13/42Processing 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/428Processing 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the invention provides a method and a device for controlling a virtual object, wherein the method comprises the following steps: determining the currently connected virtual object control equipment according to the manufacturer product model; and determining target virtual object control equipment for controlling the virtual object, and controlling the virtual object according to the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment. The device performs the above method. According to the method and the device for controlling the virtual object, the virtual object is controlled through the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the physical key information, the implementation process does not depend on a window focus, and therefore the virtual object in the virtual scene can be controlled without the window focus.

Description

Method and device for controlling virtual object
Technical Field
The invention relates to the technical field of virtual reality, in particular to a method and a device for controlling a virtual object.
Background
When the Unity rendering engine is applied in Windows, input devices such as a mouse, a keyboard, a gamepad, and the like are acquired through Windows window hooks. In the prior art, an input device handle list is mainly acquired through a Windows hook, a gamepad handle list is screened out through the input device handle list, a gamepad object is acquired through a gamepad handle in the gamepad handle list, gamepad physical key state information is acquired through the gamepad object, and a virtual object in a virtual scene is controlled through the gamepad physical key state information. When the mouse clicks outside the window or is switched to other applications, the focus of the window is lost, and the gamepad cannot control the virtual object in the virtual scene.
Disclosure of Invention
To solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for controlling a virtual object.
The embodiment of the invention provides a method for controlling a virtual object, which comprises the following steps:
determining the currently connected virtual object control equipment according to the manufacturer product model;
and determining target virtual object control equipment for controlling the virtual object, and controlling the virtual object according to the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment.
Wherein, the determining the currently connected virtual object control device according to the manufacturer product model comprises:
determining the virtual object control equipment according to the manufacturer product model and a preset first corresponding relation; the preset first corresponding relation is a corresponding relation between a preset manufacturer product model and a preset virtual object control device.
Wherein the determining of the target virtual object control device that controls the virtual object includes:
determining target virtual object control equipment for controlling the virtual object according to a preset second corresponding relation; the preset second corresponding relation is a corresponding relation between the preset virtual object and the preset virtual object control equipment.
Wherein, the controlling the virtual object according to the physical key information of the target virtual object control device and the manufacturer product model corresponding to the physical key information comprises:
determining middleware information of the control equipment according to the physical key information and the manufacturer product model corresponding to the physical key information; the control device middleware information includes at least one of a forward and backward speed, a left and right movement speed, a rising and falling speed, a pitch speed, a yaw speed and a roll lock;
and controlling the virtual object according to the control equipment middleware information.
Determining middleware information of the control equipment according to the physical key information and the manufacturer product model corresponding to the physical key information, wherein the middleware information comprises at least one of the following items:
converting the button in the physical key information corresponding to the manufacturer product model into a button in the middleware information of the control equipment; a button in the control device middleware information is used for controlling the current state of the rolling lock;
converting a rocker in the physical key information corresponding to the manufacturer product model into the speed in the middleware information of the control equipment; the speed includes at least one of the forward-reverse speed, the side-to-side movement speed, the ascent-descent speed, the pitch speed, and the yaw speed;
converting the button in the physical key information corresponding to the manufacturer product model into the speed in the middleware information of the control equipment;
converting a rocker in the physical key information corresponding to the manufacturer product model into a button in the middleware information of the control equipment;
and converting PointOfView in the physical key information corresponding to the manufacturer product model into the speed in the middleware information of the control equipment.
Converting a rocker in the physical key information corresponding to the manufacturer product model into the speed in the control equipment middleware information, wherein the speed comprises the following steps:
shielding the middle control area numerical value in the control area numerical values of the rocker;
and converting the remaining control area numerical value after the shielding treatment into a speed area numerical value corresponding to the speed.
Converting PointOfView in physical key information corresponding to the manufacturer product model into speed in the middleware information of the control equipment, wherein the speed comprises the following steps:
converting the sine value of the PointOfView into a speed value of the speed in the horizontal direction;
and converting the cosine value of the PointOfView into a speed value of the speed in the vertical direction.
An embodiment of the present invention provides an apparatus for controlling a virtual object, including:
the determining unit is used for determining the currently connected virtual object control equipment according to the manufacturer product model;
and the control unit is used for determining target virtual object control equipment for controlling the virtual object and controlling the virtual object according to the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment.
An embodiment of the present invention provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein,
the processor, when executing the computer program, implements the method steps of:
determining the currently connected virtual object control equipment according to the manufacturer product model;
and determining target virtual object control equipment for controlling the virtual object, and controlling the virtual object according to the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment.
An embodiment of the invention provides a non-transitory computer readable storage medium having a computer program stored thereon, which when executed by a processor implements the following method steps:
determining the currently connected virtual object control equipment according to the manufacturer product model;
and determining target virtual object control equipment for controlling the virtual object, and controlling the virtual object according to the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment.
According to the method and the device for controlling the virtual object, the virtual object is controlled through the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the physical key information, the implementation process does not depend on a window focus, and therefore the virtual object in the virtual scene can be controlled without the window focus.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flowchart of an embodiment of a method for controlling virtual objects;
FIG. 2 is a schematic diagram illustrating PointOfView according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for controlling a virtual object according to another embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an apparatus for controlling virtual objects according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of an embodiment of a method for controlling a virtual object, and as shown in fig. 1, the method for controlling a virtual object provided in an embodiment of the present invention includes the following steps:
s101: and determining the currently connected virtual object control equipment according to the manufacturer product model.
Specifically, the apparatus determines the currently connected virtual object control device according to the manufacturer product model. The apparatus may be a computer device for performing the above method, for example, a notebook computer used by a user. The manufacturer product model is a manufacturer product model of the virtual object control device, the currently connected virtual object control device is a virtual object control device connected to the computer device, and the virtual object control device is a control device for a virtual object in a virtual scene, including but not limited to a game pad and an HTC Vive Tracker.
The manufacturer product model includes a product type and a product global Unique Identifier (GUID for short); where a GUID is an algorithmically generated numeric identifier that is 128 bits in binary length.
Wherein, the determining the currently connected virtual object control device according to the manufacturer product model comprises:
determining the virtual object control equipment according to the manufacturer product model and a preset first corresponding relation; the preset first corresponding relation is a corresponding relation between a preset manufacturer product model and a preset virtual object control device. The preset first correspondence may be pre-established and stored in the computer device.
Examples are as follows:
the GUID in the preset manufacturer product model is 02ff045e-0000-0000-0000-504944564944, the product type in the preset manufacturer product model is Gamepad, the preset virtual object control device corresponding to the GUID and the product type is Xbox one wired connection Gamepad, and if the product type in the manufacturer product model is Gamepad and the GUID is 02ff045 e-0000-0000-504944564944, the currently connected virtual object control device can be determined to be Xbox one wired connection Gamepad according to the corresponding relation.
S102: and determining target virtual object control equipment for controlling the virtual object, and controlling the virtual object according to the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment.
Specifically, the device determines a target virtual object control device for controlling a virtual object, and controls the virtual object according to physical key information of the target virtual object control device and a manufacturer product model corresponding to the physical key information. The virtual object is a controlled object and may include a game pad controlled object.
The target virtual object control device is a virtual object control device selected from among the virtual object control devices and controlling the virtual object.
The physical key information may include direction control keys and buttons of the game pad, etc.
Wherein the determining of the target virtual object control device that controls the virtual object includes:
determining target virtual object control equipment for controlling the virtual object according to a preset second corresponding relation; the preset second corresponding relation is a corresponding relation between the preset virtual object and the preset virtual object control equipment.
The preset second corresponding relationship may be pre-established and stored in the computer device.
Examples are as follows:
the user needs to control the preset virtual object a through the preset virtual object control device a, a corresponding relationship between the preset virtual object control device a and the preset virtual object a can be established, and if the virtual object a needs to be controlled, the target virtual object control device is a.
According to the method for controlling the virtual object, the virtual object is controlled through the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment, the implementation process does not depend on the window focus, and therefore the virtual object in the virtual scene can be controlled without the window focus.
On the basis of the above embodiment, the determining, according to the manufacturer product model, the virtual object control device currently connected includes:
specifically, the virtual object control device is determined according to the manufacturer product model and a preset first corresponding relation; the preset first corresponding relation is a corresponding relation between a preset manufacturer product model and a preset virtual object control device. Reference is made to the above description and no further description is made.
According to the method for controlling the virtual object, the virtual object control equipment is determined according to the manufacturer product model and the preset first corresponding relation, the implementation process does not depend on the window focus, and therefore the virtual object in the virtual scene can be controlled without the window focus.
On the basis of the above embodiment, the determining a target virtual object control device that controls a virtual object includes:
specifically, target virtual object control equipment for controlling the virtual object is determined according to a preset second corresponding relation; the preset second corresponding relation is a corresponding relation between the preset virtual object and the preset virtual object control equipment.
In the method for controlling a virtual object provided in the embodiment of the present invention, the target virtual object control device for controlling the virtual object is determined by presetting the second corresponding relationship, and the implementation process does not depend on the window focus, so that the virtual object in the virtual scene can be controlled without passing through the window focus.
On the basis of the above embodiment, the controlling the virtual object according to the physical key information of the target virtual object control device and the manufacturer product model corresponding to the physical key information includes:
specifically, determining middleware information of the control equipment according to the physical key information and the manufacturer product model corresponding to the physical key information; the control device middleware information includes at least one of a forward and backward speed, a left and right movement speed, a rising and falling speed, a pitch speed, a yaw speed and a roll lock;
the physical key information defined by the product models of various manufacturers is not consistent, for example, as follows:
the corresponding relation between the Xbox gamepad physical keys and the physical key information numbers is as follows:
private static readonly int A=0;
private static readonly int B=1;
private static readonly int X=2;
private static readonly int Y=3;
private static readonly int L1=4;
private static readonly int R1=5;
private static readonly int BACK=6;
private static readonly int START=7;
private static readonly int L3=8;
private static readonly int R3=9。
the corresponding relation between the PS4 gamepad physical keys and the physical key information numbers is as follows:
private static readonly int A=1;
private static readonly int B=2;
private static readonly int X=0;
private static readonly int Y=3;
private static readonly int L1=4;
private static readonly int R1=5;
private static readonly int SHARE=8;
private static readonly int OPTIONS=9;
private static readonly int L3=10;
private static readonly int R3=11;
private static readonly int TOUCH=13。
because the physical key information provided by different manufacturer product models is inconsistent, the physical key information of different manufacturer product models needs to be converted into middleware information capable of controlling a virtual object, that is, control device middleware information.
The control device middleware information is corresponding to the type of the virtual object control device, and referring to the above example, if the virtual object control device is a gamepad, the control device middleware information is gamepad middleware information.
A scroll lock, includes a scroll lock, such as a scroll lock, in each plane.
Specifically, the virtual object is controlled according to the control device middleware information. That is, the operation speed of the virtual object in the three-dimensional space is controlled by controlling the forward/backward speed, the leftward/rightward movement speed, the upward/downward speed, the pitch speed, the yaw speed, and the like in the device middleware information, and the current state of the roll lock is controlled by controlling the unlocking of the roll lock or the unlocking of the roll lock in the device middleware information.
It can be understood that, because the same virtual object is controlled to have the physical key information corresponding to the product models of various manufacturers, the physical key information is uniformly converted into the middleware information of the control equipment, so that the virtual object can be controlled conveniently.
Determining middleware information of the control equipment according to the physical key information and the manufacturer product model corresponding to the physical key information, wherein the middleware information comprises at least one of the following items:
converting the button in the physical key information corresponding to the manufacturer product model into a button in the middleware information of the control equipment; a button in the control device middleware information is used for controlling the current state of the rolling lock; the mapping relationship of the physical key information mapping rollover lock corresponding to different manufacturer product models is different, for example, as follows:
mapping the Y key of the Xbox gamepad to roll-lock is a Boolean value in two states, due to the fact that if the Y key provided by DirectInput is pressed and if it is lifted. When the Y key is judged to be lifted, the Boolean value of the rolling lock is set to be opposite to the previous state, namely if the original state is 0, the current state is 1; if the original state is 1, the current state is 0.
Converting a rocker in the physical key information corresponding to the manufacturer product model into the speed in the middleware information of the control equipment; the speed includes at least one of the forward-reverse speed, the side-to-side movement speed, the ascent-descent speed, the pitch speed, and the yaw speed; the step can convert the control area values corresponding to the rockers of different manufacturer product models into speed values comprehensively, wherein the speed values can be between [ -1, 1], and the signs represent the speed directions. The mapping relation between the control area numerical value corresponding to the rocker corresponding to different manufacturer product models and the speed value is different, and the method specifically comprises the following steps:
shielding the middle control area numerical value in the control area numerical values of the rocker; the purpose of the masking processing is to prevent the problem that the virtual object cannot stop because the rocker cannot return to zero due to device errors and the like.
Examples are as follows: the control area value can be selected to be 0-65535, and when a user puts the rocker at the middle position, the middle position is not classified into the middle data 32768 due to device errors and the like.
A float value of 0 to 1 can be set autonomously according to the manufacturer's product model, indicating the area proportion of the masking treatment, for example: if the shielding processing area of the Xbox is 10%, 10% of parts adjacent to 32768 in 0-32768 fail, and the actual effective range is 0-29492; 10% of 32768-65535 with 32768 partially failed, and the actual effective range is 36044-65535.
And converting the remaining control area numerical value after the shielding treatment into a speed area numerical value corresponding to the speed. On the basis, the actual effective range of 0-29492 is linearly corresponding to-1-0; the actual effective ranges 36044-65535 are linearly related to 0-1.
Converting the button in the physical key information corresponding to the manufacturer product model into the speed in the middleware information of the control equipment; the mapping relation between the buttons and the speed values in the physical key information corresponding to different manufacturer product models is different, and the specific implementation mode is as follows:
the handle value change is carried out by utilizing an ln function, linear change is converted into nonlinear change, and the purpose is to improve the operation feeling of a user in the using process. Examples are as follows:
l3 and R3 of the Beitong handle are buttons, and L3 and R3 of the Xbox handle belong to the rocker at the keys. The L3 and R3 of the Xbox handle will be mapped to positive and negative direction speed, and the button of the Beitong handle will also be mapped to positive and negative direction speed as a uniform user interface is needed.
Taking the example that L3 of the northbound handle corresponds to the negative direction speed, taking the time T0 as the moment when L3 of the northbound handle is pressed, recording the time, and when the time is the critical time T1, that is, when any one of the time points is substituted into the ln function in the time period T0 to T1, calculating to obtain the negative direction speed, it can be understood that the negative direction speed shows nonlinear change with time in the time period T0 to T1, and when the time is T1, the negative direction speed reaches the negative direction speed critical value, that is, does not change with time any more, and is a constant value.
Taking the example that R3 of the north-pass handle corresponds to the positive direction speed, taking the time T0 as the moment when R3 of the north-pass handle is pressed, recording the time, where the value of the ln function value is 0, when the critical time T1 is reached, that is, any one of the time points is substituted into the ln function in the time period T0-T1, and calculating to obtain the negative direction speed, it can be understood that the positive direction speed shows nonlinear change with time in the time period T0-T1, and when the time T1 is reached, the positive direction speed is the positive direction speed critical value, that is, the positive direction speed does not change with time any more and is a constant value.
It can be understood that the ln function is a symmetrical function based on the horizontal axis t, and when the north-through handle is pressed at L3 and R3, the positive direction velocity and the negative direction velocity cancel each other out, and the virtual object does not move any more.
Converting a rocker in the physical key information corresponding to the manufacturer product model into a button in the middleware information of the control equipment; the control area numerical value mapping rolling locking mapping relations corresponding to the rockers of different manufacturer product models are different. And when the numerical value of the control area does not reach the critical value, the button in the middleware information of the control equipment is not triggered to be lifted.
And converting PointOfView in the physical key information corresponding to the manufacturer product model into the speed in the middleware information of the control equipment. pointofView is a general term in the art, fig. 2 is a schematic illustration of the description of pointofView according to the embodiment of the present invention, and as shown in fig. 2, when the user controls the joystick from the Y axis to the OC, the angle θ of the deflection is pointofView.
The method specifically comprises the following steps:
converting the sine value of the PointOfView into a speed value of the speed in the horizontal direction; referring to fig. 2, sin θ is BC/OC, OC is the radius of the circle, and the value is 1, which can be directly converted into the numerical value of the speed region between [ -1, 1 ].
And converting the cosine value of the PointOfView into a speed value of the speed in the vertical direction. Referring to fig. 2, cos θ is OB/OC, OC is the radius of the circle, and the value is 1, which can be directly converted into the value of the speed region between [ -1, 1 ].
The above θ may be determined as follows:
taking the handle as an example, data of 0-36000 is generated according to the user's shaking direction, upper left, lower right, and upper right. The above-mentioned rocking direction and value are as follows:
upper, corresponds to 0;
top right, corresponding to 4500;
right, corresponding to 9000;
bottom right, corresponding to 13500;
next, it corresponds to 18000;
bottom left, corresponding to 22500;
left, corresponding to 27000;
top left, corresponding to 31500.
For the upper right example, θ is (4500/36000) × 360 ° is 45 °.
The method for controlling the virtual object provided by the embodiment of the invention controls the virtual object through the middleware information of the control equipment, so that the virtual object control equipment of different manufacturer product models can conveniently and uniformly control the virtual object.
On the basis of the above embodiment, the determining control device middleware information according to the physical key information and the manufacturer product model corresponding to the physical key information includes at least one of the following items:
specifically, a button in the physical key information corresponding to the manufacturer product model is converted into a button in the middleware information of the control equipment; a button in the control device middleware information is used for controlling the current state of the rolling lock; reference is made to the above description and no further description is made.
Specifically, a rocker in the physical key information corresponding to the manufacturer product model is converted into the speed in the control equipment middleware information; the speed includes at least one of the forward-reverse speed, the side-to-side movement speed, the ascent-descent speed, the pitch speed, and the yaw speed; reference is made to the above description and no further description is made.
Specifically, a button in the physical key information corresponding to the manufacturer product model is converted into a speed in the control device middleware information; reference is made to the above description and no further description is made.
Specifically, a rocker in the physical key information corresponding to the manufacturer product model is converted into a button in the middleware information of the control equipment; reference is made to the above description and no further description is made.
Specifically, the pointoofview in the physical key information corresponding to the manufacturer product model is converted into the speed in the control device middleware information. Reference is made to the above description and no further description is made.
According to the method for controlling the virtual object, the specific content in the physical key information is converted into the specific content in the middleware information of the control equipment, so that the virtual object control equipment of different manufacturer product models can control the virtual object uniformly.
On the basis of the above embodiment, the converting the rocker in the physical key information corresponding to the manufacturer product model into the speed in the control device middleware information includes:
specifically, shielding a middle control area numerical value in the control area numerical values of the rocker; reference is made to the above description and no further description is made.
Specifically, the remaining control area value after the shielding processing is converted into a speed area value corresponding to the speed. Reference is made to the above description and no further description is made.
The method for controlling the virtual object provided by the embodiment of the invention solves the problem that the virtual object cannot stop due to the fact that the rocker cannot return to zero due to device errors and the like, and improves the applicability of the rocker for controlling the virtual object.
On the basis of the above embodiment, the converting the PointOfView in the physical key information corresponding to the manufacturer product model into the speed in the control device middleware information includes:
specifically, the sine value of the PointOfView is converted into a speed value of the speed along the horizontal direction; reference is made to the above description and no further description is made.
Specifically, the cosine value of the PointOfView is converted into a speed value of the speed in the vertical direction. Reference is made to the above description and no further description is made.
The method for controlling the virtual object provided by the embodiment of the invention can realize accurate control on the speed of the virtual object for the virtual object control equipment generating the deflection angle.
Fig. 3 is a flowchart of another embodiment of the method for controlling a virtual object according to the present invention, and as shown in fig. 3, the device instance list according to the embodiment of the present invention may include an Xbox wired handle, a PS4 wired handle, and the like.
Obtaining a device instance list through DirectInput, wherein the types of the device instances comprise the following contents:
device, Mouse, Keyboard, Joystick, Gamepad, Driving, Flight, FirstPerson, ControlDevice, ScreenPointer, Remote, and supplement, etc.
The currently connected gamepad is determined according to the manufacturer's model, and the description of the currently connected virtual object control device according to the manufacturer's model may be referred to above.
The physical key information of the game handle is obtained in a mature technology in the field, and the obtaining mode is not described in detail.
The handle data middleware is determined according to the physical key information and the manufacturer product model, and the description of the middleware information of the control equipment can be determined according to the physical key information and the manufacturer product model corresponding to the physical key information.
And controlling the position and the posture of the controlled object according to the handle data middleware, and referring to the description for controlling the virtual object according to the middleware information of the control equipment.
Fig. 4 is a schematic structural diagram of an apparatus for controlling a virtual object according to an embodiment of the present invention, and as shown in fig. 4, an apparatus for controlling a virtual object according to an embodiment of the present invention includes a determining unit 401 and a controlling unit 402, where:
the determining unit 401 is configured to determine a currently connected virtual object control device according to a manufacturer product model; the control unit 402 is configured to determine a target virtual object control device for controlling a virtual object, and control the virtual object according to physical key information of the target virtual object control device and a manufacturer product model corresponding to the physical key information.
Specifically, the determining unit 401 is configured to determine the currently connected virtual object control device according to the manufacturer product model; the control unit 402 is configured to determine a target virtual object control device for controlling a virtual object, and control the virtual object according to physical key information of the target virtual object control device and a manufacturer product model corresponding to the physical key information.
The device for controlling the virtual object provided by the embodiment of the invention controls the virtual object through the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment, and the implementation process does not depend on the window focus, so that the virtual object in the virtual scene can be controlled without the window focus.
The apparatus for controlling a virtual object provided in the embodiment of the present invention may be specifically configured to execute the processing flows of the above method embodiments, and the functions of the apparatus are not described herein again, and refer to the detailed description of the above method embodiments.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 5, the electronic device includes: a processor (processor)501, a memory (memory)502, and a bus 503;
the processor 501 and the memory 502 complete communication with each other through a bus 503;
the processor 501 is configured to call program instructions in the memory 502 to perform the methods provided by the above-mentioned method embodiments, for example, including: determining the currently connected virtual object control equipment according to the manufacturer product model; and determining target virtual object control equipment for controlling the virtual object, and controlling the virtual object according to the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising: determining the currently connected virtual object control equipment according to the manufacturer product model; and determining target virtual object control equipment for controlling the virtual object, and controlling the virtual object according to the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided by the above method embodiments, for example, including: determining the currently connected virtual object control equipment according to the manufacturer product model; and determining target virtual object control equipment for controlling the virtual object, and controlling the virtual object according to the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of controlling a virtual object, comprising:
determining the currently connected virtual object control equipment according to the manufacturer product model;
and determining target virtual object control equipment for controlling the virtual object, and controlling the virtual object according to the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment.
2. The method of claim 1, wherein determining a currently connected virtual object control device based on a vendor product model number comprises:
determining the virtual object control equipment according to the manufacturer product model and a preset first corresponding relation; the preset first corresponding relation is a corresponding relation between a preset manufacturer product model and a preset virtual object control device.
3. The method of claim 1, wherein determining a target virtual object control device to control a virtual object comprises:
determining target virtual object control equipment for controlling the virtual object according to a preset second corresponding relation; the preset second corresponding relation is a corresponding relation between the preset virtual object and the preset virtual object control equipment.
4. The method according to any one of claims 1 to 3, wherein the controlling the virtual object according to the physical key information of the target virtual object control device and the manufacturer product model corresponding to the physical key information comprises:
determining middleware information of the control equipment according to the physical key information and the manufacturer product model corresponding to the physical key information; the control device middleware information includes at least one of a forward and backward speed, a left and right movement speed, a rising and falling speed, a pitch speed, a yaw speed and a roll lock;
and controlling the virtual object according to the control equipment middleware information.
5. The method of claim 4, wherein determining control device middleware information based on the physical key information and a manufacturer product model corresponding thereto comprises at least one of:
converting the button in the physical key information corresponding to the manufacturer product model into a button in the middleware information of the control equipment; a button in the control device middleware information is used for controlling the current state of the rolling lock;
converting a rocker in the physical key information corresponding to the manufacturer product model into the speed in the middleware information of the control equipment; the speed includes at least one of the forward-reverse speed, the side-to-side movement speed, the ascent-descent speed, the pitch speed, and the yaw speed;
converting the button in the physical key information corresponding to the manufacturer product model into the speed in the middleware information of the control equipment;
converting a rocker in the physical key information corresponding to the manufacturer product model into a button in the middleware information of the control equipment;
and converting PointOfView in the physical key information corresponding to the manufacturer product model into the speed in the middleware information of the control equipment.
6. The method of claim 5, wherein converting the rocker in the physical key information corresponding to the vendor product model number to the speed in the control device middleware information comprises:
shielding the middle control area numerical value in the control area numerical values of the rocker;
and converting the remaining control area numerical value after the shielding treatment into a speed area numerical value corresponding to the speed.
7. The method of claim 5, wherein translating the pointoofview in the physical key information corresponding to the vendor product model to the speed in the control device middleware information comprises:
converting the sine value of the PointOfView into a speed value of the speed in the horizontal direction;
and converting the cosine value of the PointOfView into a speed value of the speed in the vertical direction.
8. An apparatus for controlling a virtual object, comprising:
the determining unit is used for determining the currently connected virtual object control equipment according to the manufacturer product model;
and the control unit is used for determining target virtual object control equipment for controlling the virtual object and controlling the virtual object according to the physical key information of the target virtual object control equipment and the manufacturer product model corresponding to the target virtual object control equipment.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202010755188.6A 2020-07-30 2020-07-30 Method and device for controlling virtual object Pending CN111957038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010755188.6A CN111957038A (en) 2020-07-30 2020-07-30 Method and device for controlling virtual object

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010755188.6A CN111957038A (en) 2020-07-30 2020-07-30 Method and device for controlling virtual object

Publications (1)

Publication Number Publication Date
CN111957038A true CN111957038A (en) 2020-11-20

Family

ID=73363737

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010755188.6A Pending CN111957038A (en) 2020-07-30 2020-07-30 Method and device for controlling virtual object

Country Status (1)

Country Link
CN (1) CN111957038A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116036578A (en) * 2023-01-28 2023-05-02 腾讯科技(深圳)有限公司 Data processing method and device and related equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010051736A (en) * 2008-08-29 2010-03-11 Bandai Co Ltd Game device and computer program
CN102662879A (en) * 2012-03-15 2012-09-12 北京视博云科技有限公司 Processing method and system for input of multiplex peripheral equipment based on Windows operation system
CN103440402A (en) * 2013-08-01 2013-12-11 青岛海信传媒网络技术有限公司 Method and device for controlling electronic game basing on middleware
CN104267943A (en) * 2014-09-19 2015-01-07 许磊 Peripheral adapting device and method
CN104922903A (en) * 2014-03-20 2015-09-23 中国电信股份有限公司 Method and system for expanding Android system to support multiple handles
CN105425936A (en) * 2014-09-19 2016-03-23 中兴通讯股份有限公司 Method, apparatus, and terminal for adapting terminal to external device
CN109701263A (en) * 2018-11-30 2019-05-03 腾讯科技(深圳)有限公司 The control method and operation controller of operation
CN110302542A (en) * 2019-05-16 2019-10-08 咪咕互动娱乐有限公司 Application program control method and device, server and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010051736A (en) * 2008-08-29 2010-03-11 Bandai Co Ltd Game device and computer program
CN102662879A (en) * 2012-03-15 2012-09-12 北京视博云科技有限公司 Processing method and system for input of multiplex peripheral equipment based on Windows operation system
CN103440402A (en) * 2013-08-01 2013-12-11 青岛海信传媒网络技术有限公司 Method and device for controlling electronic game basing on middleware
CN104922903A (en) * 2014-03-20 2015-09-23 中国电信股份有限公司 Method and system for expanding Android system to support multiple handles
CN104267943A (en) * 2014-09-19 2015-01-07 许磊 Peripheral adapting device and method
CN105425936A (en) * 2014-09-19 2016-03-23 中兴通讯股份有限公司 Method, apparatus, and terminal for adapting terminal to external device
CN109701263A (en) * 2018-11-30 2019-05-03 腾讯科技(深圳)有限公司 The control method and operation controller of operation
CN110302542A (en) * 2019-05-16 2019-10-08 咪咕互动娱乐有限公司 Application program control method and device, server and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116036578A (en) * 2023-01-28 2023-05-02 腾讯科技(深圳)有限公司 Data processing method and device and related equipment

Similar Documents

Publication Publication Date Title
KR102602113B1 (en) Information interaction methods and related devices
CN114641375A (en) Dynamic programming controller
CN111957038A (en) Method and device for controlling virtual object
CN112184851B (en) Image editing method, network training method, related device and electronic equipment
CN111598987B (en) Skeleton processing method, device, equipment and storage medium of virtual object
CN109634428B (en) Electronic equipment, feedback prompting method and device and terminal equipment
JP2021154657A (en) Computer program, machine learning machine, information processing method, and molder
CN107844645B (en) BIM-based collaboration initiating method and device
CN118334190A (en) Information processing method and device, electronic equipment and readable storage medium
CN108885556A (en) Control numeral input
EP3772024A1 (en) Management device, management method, and management program
KR102637774B1 (en) Method and system for providing automated 3d modeling for xr online platform
JP2000047567A (en) Tactile sense simulation device for object
US10909754B1 (en) Visual scripting for multi-dimensional elements
US8326442B2 (en) Constrained navigation in a three-dimensional (3D) virtual arena
AU2019283790B2 (en) Dynamic brush model with a single rgb stamp texture
CN115115814A (en) Information processing method, information processing apparatus, readable storage medium, and electronic apparatus
Harbert et al. A graphical specification system for user-interface design
US10984144B2 (en) Data publishing system
US12039634B2 (en) Three-dimensional vector-based brushes
CN109656557B (en) User interface generation method and device
CN110659025B (en) Recommendation method and device
CN116619351B (en) Design method of interval observer of mechanical arm system based on event trigger mechanism
CN114388059B (en) Protein section generation method based on three-dimensional force feedback controller
US12050793B2 (en) Cloud system for individual peripheral device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20201120