WO2021169911A1 - 仿真灭火器松动干粉的方法、装置、设备及存储介质 - Google Patents

仿真灭火器松动干粉的方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2021169911A1
WO2021169911A1 PCT/CN2021/077224 CN2021077224W WO2021169911A1 WO 2021169911 A1 WO2021169911 A1 WO 2021169911A1 CN 2021077224 W CN2021077224 W CN 2021077224W WO 2021169911 A1 WO2021169911 A1 WO 2021169911A1
Authority
WO
WIPO (PCT)
Prior art keywords
fire extinguisher
included angle
angle value
dry powder
inversions
Prior art date
Application number
PCT/CN2021/077224
Other languages
English (en)
French (fr)
Inventor
夏露辉
许秋子
Original Assignee
深圳市瑞立视多媒体科技有限公司
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 深圳市瑞立视多媒体科技有限公司 filed Critical 深圳市瑞立视多媒体科技有限公司
Publication of WO2021169911A1 publication Critical patent/WO2021169911A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2203/00Indexing scheme relating to G06F3/00 - G06F3/048
    • G06F2203/01Indexing scheme relating to G06F3/01
    • G06F2203/012Walk-in-place systems for allowing a user to walk in a virtual environment while constraining him to a given position in the physical environment

Definitions

  • the invention relates to the field of motion capture, in particular to a method, device, equipment and storage medium for simulating the loosening of dry powder of a fire extinguisher.
  • the dry powder in the dry powder fire extinguisher needs to be fully loosened before the dry powder fire extinguisher can be used for fire fighting.
  • the virtual scene is used to simulate the process of loosening the dry powder of the dry powder fire extinguisher, so that people can deepen the impression of using the dry powder fire extinguisher, and can Use dry powder fire extinguishers correctly when encountering danger.
  • the fire extinguisher is attached to the handle of the application of the motion capture system, and the movement of the handle drives the fire extinguisher to move.
  • the position difference between the current frame and the previous frame of the fire extinguisher is calculated and divided by the movement from the previous frame to the current frame.
  • the real-time speed of the fire extinguisher is obtained. If the speed exceeds the threshold, it can be timed. If the speed is lower than the threshold, the timer will be reset to obtain the duration. If the duration reaches the threshold, the dry powder in the fire extinguisher has been successfully loosened. , You can go to the next step.
  • the simulation does not conform to the correctness of the operation of the fire extinguisher, resulting in lower fire extinguishing efficiency when facing the real fire scene.
  • the main purpose of the present invention is to solve the problem that the dry powder loosening operation of the simulated dry powder fire extinguisher has low accuracy, resulting in low fire extinguishing efficiency when facing the real fire scene.
  • the first aspect of the present invention provides a method for simulating the loose powder of a fire extinguisher, which includes: initializing the Z-axis direction of the fire extinguisher to be a vertical upward direction, and obtaining a unit vector in the vertical direction; when the motion capture data is received, obtaining it in real time
  • the unit vector in the Z-axis direction of the fire extinguisher, the motion capture data is used to instruct the upside down operation of the fire extinguisher; the angle between the unit vector in the Z-axis direction of the fire extinguisher and the unit vector in the vertical direction is calculated , Obtain the included angle value; update the number of inversions and the accumulation flag according to the included angle value, the minimum threshold and the maximum threshold, the accumulation flag is used to indicate whether to update the number of inversions; when the number of inversions When it is greater than or equal to the preset number of successful inversions, and the included angle value is less than the minimum threshold, it is determined that the dry powder in the fire ex
  • the unit vector in the Z-axis direction of the fire extinguisher is acquired in real time, and the motion capture data is used to indicate
  • the upside-down operation of the fire extinguisher includes: when the motion capture data is received, the unit vector of the Z-axis direction of the fire extinguisher is calculated in real time according to a preset function, and the motion capture data is used to instruct the fire extinguisher to be upside down operate.
  • the number of inversions and the accumulation indicator are updated according to the included angle value, the minimum threshold and the maximum threshold, and the accumulation indicator is used to indicate whether to
  • the updating of the number of times of inversion includes: judging whether the included angle value is greater than a minimum threshold; if the included angle value is less than or equal to the minimum threshold, setting the accumulation flag to be logically true, and the accumulation flag is used to indicate Whether to update the number of inversions; if the included angle value is greater than the minimum threshold, update the number of inversions according to the included angle value, the maximum threshold, and the cumulative identifier.
  • the updating of the number of inversions includes: if the included angle value is greater than the minimum threshold value, judging whether the included angle value is less than the maximum threshold value; if the included angle value is less than the maximum threshold value, continue Perform an upside-down operation on the fire extinguisher; if the included angle value is greater than or equal to the maximum threshold value, the number of inversions is updated according to the accumulated identifier.
  • updating the number of inversions according to the accumulation identifier includes : If the included angle value is greater than or equal to the maximum threshold value, determine whether the accumulation indicator is the logical true; if the accumulation indicator is the logical true, obtain the number of inversions, and compare the The number of inversions is calculated by adding 1, and the initial value of the number of inversions is 0; the accumulation flag is set to logical false.
  • the method for the simulated fire extinguisher to loosen the dry powder further includes: when the game end instruction is detected when the fire extinguisher is turned upside down, setting the number of inversions to 0.
  • the second aspect of the present invention provides a device for simulating loose powder of a fire extinguisher, comprising: an initialization module for initializing the Z-axis direction of the fire extinguisher to be a vertical upward direction, and obtaining a unit vector in the vertical direction; the obtaining module, when receiving When it comes to the motion capture data, it is used to obtain the unit vector of the Z-axis direction of the fire extinguisher in real time.
  • the motion capture data is used to instruct the upside down operation of the fire extinguisher; the calculation module is used to calculate the Z-axis of the fire extinguisher.
  • the angle between the unit vector in the direction and the unit vector in the vertical direction is calculated to obtain an angle value;
  • the update module is used to update the number of inversions and the accumulated flag according to the angle value, the minimum threshold and the maximum threshold.
  • the accumulation flag is used to indicate whether to update the number of inversions;
  • the determining module when the number of inversions is greater than or equal to the preset number of successful inversions, and the included angle value is less than or equal to the minimum threshold, Used to determine that the dry powder in the fire extinguisher has been loosened.
  • the acquisition module is specifically configured to: when the motion capture data is received, calculate the unit vector in the Z-axis direction of the fire extinguisher in real time according to a preset function , The motion capture data is used to instruct the upside down operation of the fire extinguisher.
  • the calculation module is specifically configured to: calculate the unit vector a in the Z-axis direction of the fire extinguisher and the vertical direction according to a preset included angle formula
  • the unit vector b is calculated to obtain the included angle value ⁇
  • the update module includes: a judging unit, configured to judge whether the included angle value is greater than a minimum threshold; and a setting unit, if the included angle value is less than Or equal to the minimum threshold, it is used to set the accumulation flag to be logically true, the accumulation flag is used to indicate whether to update the number of inversions; the update unit is used to if the included angle value is greater than the minimum
  • the threshold value is used to update the number of inversions according to the included angle value, the maximum threshold value, and the accumulation identifier.
  • the update unit includes: a judging subunit, and if the included angle value is greater than the minimum threshold, then it is used to determine whether the included angle value is Is less than the maximum threshold; operating sub-unit, if the included angle value is less than the maximum threshold, it is used to continue to operate the fire extinguisher upside down; update the sub-unit, if the included angle value is greater than or equal to the The maximum threshold is used to update the number of inversions according to the accumulation identifier.
  • the update subunit is specifically configured to: if the included angle value is greater than or equal to the maximum threshold value, determine whether the accumulated identifier is the same. The logic is true; if the accumulation flag is the logical truth, then the number of inversions is obtained, and the number of inversions is calculated by adding 1, the initial value of the number of inversions is 0; the accumulation is The flag is set to logical false.
  • the device for simulating the dry powder of the fire extinguisher further includes: a reset module, when the game end instruction is detected while the fire extinguisher is upside down, Used to reset the number of inversions to 0.
  • the third aspect of the present invention provides a device for simulating loose powder of a fire extinguisher, which includes: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected by wires; At least one processor invokes the instructions in the memory, so that the device for simulating the dry powder of the fire extinguisher to loosen dry powder executes the above-mentioned method for simulating the dry powder of the fire extinguisher to loosen the dry powder.
  • a fourth aspect of the present invention provides a computer-readable storage medium having instructions stored in the computer-readable storage medium, which when run on a computer, cause the computer to execute the above-mentioned method for simulating a fire extinguisher to loosen dry powder.
  • the Z-axis direction of the fire extinguisher is initialized to be the vertical upward direction, and the unit vector in the vertical direction is obtained; when the motion capture data is received, the unit vector in the Z-axis direction of the fire extinguisher is obtained in real time
  • the motion capture data is used to indicate the upside-down operation of the fire extinguisher; calculate the included angle between the unit vector in the Z-axis direction of the fire extinguisher and the unit vector in the vertical direction to obtain the included angle value;
  • the angle value, the minimum threshold and the maximum threshold update the number of inversions and the accumulation flag, the accumulation flag is used to indicate whether to update the number of inversions; when the number of inversions is greater than or equal to the preset number of successful inversions, And when the included angle value is less than the minimum threshold, it is determined that the dry powder in the fire extinguisher has been loosened.
  • the upside-down operation of the fire extinguisher in the game scene is controlled by two handles, the angle between the Z-axis direction of the fire extinguisher and the vertical direction is calculated in real time, and the number of times the fire extinguisher has been inverted is counted according to the angle value.
  • the user can correctly use the dry powder fire extinguisher to loosen the dry powder by simulating the virtual scene, and improve the fire extinguishing efficiency in the real fire scene.
  • Fig. 1 is a schematic diagram of an embodiment of a method for simulating a fire extinguisher to loosen dry powder in an embodiment of the present invention
  • FIG. 2 is a schematic diagram of another embodiment of a method for loosening dry powder of a simulated fire extinguisher in an embodiment of the present invention
  • FIG. 3 is a schematic diagram of an embodiment of a device for loosening dry powder of a simulated fire extinguisher in an embodiment of the present invention
  • FIG. 4 is a schematic diagram of another embodiment of a device for loosening dry powder of a simulated fire extinguisher in an embodiment of the present invention
  • Fig. 5 is a schematic diagram of an embodiment of a device for simulating a fire extinguisher for loosening dry powder in an embodiment of the present invention.
  • the embodiment of the present invention provides a method, device, equipment and storage medium for simulating the loose powder of a fire extinguisher.
  • Two handles are used to control the upside down operation of the fire extinguisher in a game scene, and the difference between the Z axis direction and the vertical direction of the fire extinguisher is calculated in real time. Include the angle value, and count the number of times the fire extinguisher has been inverted according to the included angle value until the dry powder in the fire extinguisher has been loosened.
  • the user can use the dry powder fire extinguisher to loosen the dry powder correctly and improve the fire extinguishing efficiency in the real fire scene.
  • an embodiment of a method for simulating a fire extinguisher to loosen dry powder includes:
  • the unit vector refers to a vector with a modulus equal to 1, and the unit vector is a non-zero vector and has a certain direction. Therefore, the server collects the corresponding modulus 1 vector from the vertical direction to obtain the unit vector in the vertical direction.
  • the initial Z-axis direction of the fire extinguisher is a vertical upward direction, that is, the initial state of the Z-axis direction of the fire extinguisher is consistent with the vertical direction.
  • the vertical direction which is perpendicular to the horizon or the horizontal line.
  • the server uses the z-axis of the ground coordinate system as the vertical direction, and the fire extinguisher It is a dry powder fire extinguisher.
  • the execution subject of the present invention may be a device that simulates a fire extinguisher for loosening dry powder, or may be a terminal or a server, which is not specifically limited here.
  • the embodiment of the present invention is described by taking the server as the execution subject as an example.
  • the unit vector in the Z-axis direction of the fire extinguisher is acquired in real time, and the motion capture data is used to instruct the fire extinguisher to perform an upside-down operation.
  • the motion capture data is the data collected in real time by the motion capture system.
  • the essence of motion capture is to measure, track and record the motion trajectory of an object in a three-dimensional space.
  • the server collects a modulo 1 vector from the Z-axis direction of the fire extinguisher in real time to obtain the unit vector of the Z-axis direction of the fire extinguisher.
  • the server performs a modulo operation on the unit vector in the Z-axis direction of the fire extinguisher to obtain the first modulus value; the server performs a modulo operation on the unit vector in the vertical direction to obtain the second modulus value; The second modulus value is multiplied to obtain the first calculation result; the server performs the product calculation on the unit vector in the Z-axis direction of the fire extinguisher and the unit vector in the vertical direction to obtain the second calculation result, and the second calculation result is 1; The unit vector in the Z-axis direction of the fire extinguisher and the unit vector in the vertical direction are multiplied to obtain the initial vector product; the server divides the initial vector product by the second operation result to obtain the target vector product, and the server calculates the target vector product according to the inverse cosine function Perform calculations to obtain the included angle value.
  • the server sets the accumulation times as the first target value, and the accumulation flag is used to indicate whether to update the number of times that have been inverted; when the included angle value is greater than or equal to the minimum
  • the server continues to perform the inversion operation; when the included angle value is greater than or equal to the maximum threshold value, and the cumulative identifier is the first target value, the number of inversions is increased by 1, and the number of inversions is An integer greater than or equal to 0, and the accumulation flag is set to the second target value at the same time.
  • the minimum threshold is 5 degrees
  • the maximum threshold is 176 degrees
  • the value interval of the included angle value is greater than or equal to 0 degrees and less than or equal to 180 degrees.
  • the first target value is used to indicate logical truth
  • the second target value is used to indicate logical false.
  • the Z-axis direction of the fire extinguisher rotates from a vertical upward direction to a vertical downward direction
  • the number of inversions is accumulated once.
  • the Z-axis direction of the fire extinguisher changes from a vertical downward direction to a vertical downward direction
  • the server will not repeatedly count the number of inversions because the cumulative identification is the second target value, so as to ensure the correctness of the number of inversions.
  • the server repeats steps 102 to 104 until the number of inversions is greater than or equal to the preset number of successful inversions, the server determines whether the included angle value is less than or equal to the minimum threshold, and if the included angle value is greater than the minimum threshold, the Z axis of the fire extinguisher The direction of rotation moves to the vertical upward direction; if the included angle value is less than or equal to the minimum threshold, it is determined that the dry powder in the fire extinguisher has been loosened, and other operations can be performed on the fire extinguisher. For example, when the preset number of successful inversions is 10, the number of inversions is 11, and the included angle value is less than the minimum threshold, the dry powder in the server fire extinguisher has been loosened.
  • the upside-down operation of the fire extinguisher can also be applied to teaching or fire drills, so that people can operate the fire extinguisher correctly, and use the upside-down method to fully loosen the dry powder in the fire extinguisher to achieve a better fire extinguishing effect. .
  • the upside-down operation of the fire extinguisher in the game scene is controlled by two handles, the angle between the Z-axis direction of the fire extinguisher and the vertical direction is calculated in real time, and the number of times the fire extinguisher has been inverted is counted according to the angle value.
  • the user can correctly use the dry powder fire extinguisher to loosen the dry powder by simulating the virtual scene, and improve the fire extinguishing efficiency in the real fire scene.
  • FIG. 2 another embodiment of a method for simulating a fire extinguisher to loosen dry powder in an embodiment of the present invention includes:
  • the Z-axis direction of the fire extinguisher initialized by the server is the vertical upward direction, that is, in the initial state, the Z-axis direction of the fire extinguisher is consistent with the vertical direction, but during the upside-down operation of the fire extinguisher, the Z-axis direction of the fire extinguisher changes in real time of.
  • the server can obtain a vertical vector with a modulus of 1 as the vertical unit vector, or obtain a vertical non-zero vector, and divide the non-zero vector by the modulus of the non-zero vector to obtain the vertical
  • the unit vector of the direction is not specifically limited here.
  • the unit vector of the Z-axis direction of the fire extinguisher is calculated in real time according to the preset function, and the motion capture data is used to indicate the upside down operation of the fire extinguisher.
  • the two handles Before controlling the upside down operation of the fire extinguisher, first tie the two handles to the rigid body of the motion capture data to realize the virtual interconnection between the two handles and the fire extinguisher.
  • the motion capture sensors on the two handles collect the corresponding motion processes in real time.
  • the motion capture data of the two handles realizes the virtual operation of the fire extinguisher, ensuring that the handle in the game scene is synchronized with the position of the handle in the real scene.
  • a user interface is used on one handle to prompt the user to use the handle to touch the fire extinguisher, and the middle finger button is pressed to make the fire extinguisher attached to the handle.
  • the user interface is used on the other handle to prompt the user to use this handle to touch the fire extinguisher.
  • the fire extinguisher press and hold the middle finger key, and then the fire extinguisher is turned upside down, and the calculation of the fire extinguisher starts to be reversed.
  • the server calculates the unit vector in the Z axis direction of the fire extinguisher in real time according to the preset function.
  • the motion capture data is used to indicate the upside down operation of the fire extinguisher.
  • the preset function can be in the Unreal game. Get the vector function GetActorUpVector().
  • the included angle value is the included angle value of the fire extinguisher in the current frame. Since the Z-axis direction of the fire extinguisher is constantly changing with the upside down operation, the server needs to calculate the included angle value of the fire extinguisher in the current frame in real time.
  • the server obtains the minimum threshold value; the server performs a difference operation between the included angle value and the minimum threshold value to obtain the operation result; the server determines whether the operation result is greater than 0; if the included angle value is greater than 0, the server determines that the included angle value is greater than the minimum threshold; if If the calculation result is less than or equal to 0, the server determines that the included angle value is less than or equal to the minimum threshold.
  • the server sets the minimum threshold value to 13 degrees. If the included angle value is 20 degrees, the server determines that the included angle value is greater than the minimum threshold; if the included angle value is 6 degrees or 13 degrees, the server determines that the included angle value is less than or equal to the minimum value. Threshold.
  • the accumulation flag is set to be logically true, and the accumulation flag is used to indicate whether to update the number of inversions.
  • the server determines that the fire extinguisher's Z-axis direction has not rotated from the vertical upward direction to the vertical downward direction during the upside-down operation of the fire extinguisher, or the Z-axis direction of the fire extinguisher From the vertical downward direction to the vertical upward direction to rotate and move again, the server cumulative identification is logically true, and the logical true is used to indicate that the server can update the number of times that have been inverted. Among them, the number of inverted times is used to count the number of times the fire extinguisher is successfully turned upside down. The limiting condition for updating the number of inverted times is that the server determines that the cumulative flag is logically true, and the number of inverted times can be updated.
  • the cumulative identification is a Boolean variable
  • the Boolean variable refers to a variable with two logic states, that is, logically true and logically false. 1 or 0 can be used to represent the logical true or logical false of the accumulation identification, and true or false can also be used to represent the logical true or logical false of the accumulation identification, which is not specifically limited here.
  • the maximum threshold is used to indicate that the Z-axis direction of the fire extinguisher rotates from a vertical upward direction to a vertical downward direction.
  • the maximum threshold value is set to 170 degrees. It is understandable that the server divides the upside down area into a first inverted area with an included angle value less than or equal to the minimum threshold, a second inverted area with an included angle value greater than the minimum threshold and an included angle value less than the maximum threshold, and an included angle value The third inversion area that is greater than or equal to the maximum threshold.
  • the server determines whether the included angle value is less than the maximum threshold value; if the included angle value is less than the maximum threshold value, the fire extinguisher continues to be turned upside down; if the included angle value is greater than or equal to the maximum threshold value, then The server updates the number of inversions according to the accumulated identifier. Further, if the included angle value is greater than the minimum threshold, it is judged whether the included angle value is less than the maximum threshold; if the included angle value is less than the maximum threshold, the fire extinguisher is continuously turned upside down; if If the included angle value is greater than or equal to the maximum threshold value, the root server updates the number of inversions according to the cumulative identifier.
  • the server determines whether the cumulative identifier is the Logically true; if the accumulation flag is the logically true, the server obtains the number of inversions, and adds 1 to the number of inversions.
  • the initial value of the number of inversions is 0, for example, it has been inverted The number of times is 3, and the fire extinguisher is successfully turned upside down once again, then the number of times of inversions is 4; the server sets the accumulation flag to logical false.
  • the server sets the cumulative flag to be logically true; when the Z-axis direction of the fire extinguisher is in the third inverted zone, the server sets the cumulative flag to logically false.
  • the server is restricted by conditions, it cannot update the number of inverted times to prevent the occurrence of a successful inversion once, and the number of inverted times updated for multiple times, resulting in inaccurate statistics on the number of times the fire extinguisher is successfully turned upside down.
  • the server determines whether the number of inversions is less than the preset number of successful inversions; if the number of inversions is less than the preset number of successful inversions, the server continues to perform steps 202 to 206; if the number of inversions is greater than or equal to the preset successful inversions If the angle is greater than the minimum threshold, the server continues to perform steps 202 to 206; if the angle is less than or equal to the minimum threshold, the Z-axis direction of the fire extinguisher is vertical upward At this time, when the fire extinguisher is in the upright snatch state, it can be regarded as the fire extinguisher has been turned upside down, the dry powder in the fire extinguisher has been loosened, and the fire extinguisher can enter the next operation.
  • the server receives the game end instruction, and the fire extinguisher will fall on the ground in the virtual scene. At this time, the number of inversions will be reset to 0 , If the game needs to perform the above calculation again.
  • the upside-down operation of the fire extinguisher in the game scene is controlled by two handles, the angle between the Z-axis direction of the fire extinguisher and the vertical direction is calculated in real time, and the number of times the fire extinguisher has been inverted is counted according to the angle value.
  • the user can correctly use the dry powder fire extinguisher to loosen the dry powder by simulating the virtual scene, and improve the fire extinguishing efficiency in the real fire scene.
  • the initialization module 301 is used to initialize the Z-axis direction of the fire extinguisher to be a vertical upward direction, and to obtain a unit vector in the vertical direction;
  • the acquisition module 302 when receiving the motion capture data, is used to acquire the unit vector of the Z axis direction of the fire extinguisher in real time, and the motion capture data is used to instruct the upside down operation of the fire extinguisher;
  • the calculation module 303 is used to calculate the included angle between the unit vector in the Z-axis direction of the fire extinguisher and the unit vector in the vertical direction to obtain the included angle value;
  • the update module 304 is configured to update the number of inversions and the accumulation indicator according to the included angle value, the minimum threshold and the maximum threshold, and the accumulation indicator is used to indicate whether to update the number of inversions;
  • the determining module 305 is used to determine that the dry powder in the fire extinguisher has been loosened when the number of inversions is greater than or equal to the preset number of successful inversions and the included angle value is less than or equal to the minimum threshold.
  • the upside-down operation of the fire extinguisher in the game scene is controlled by two handles, the angle between the Z-axis direction of the fire extinguisher and the vertical direction is calculated in real time, and the number of times the fire extinguisher has been inverted is counted according to the angle value.
  • the user can correctly use the dry powder fire extinguisher to loosen the dry powder by simulating the virtual scene, and improve the fire extinguishing efficiency in the real fire scene.
  • FIG. 4 another embodiment of a device for simulating a fire extinguisher to loosen dry powder in an embodiment of the present invention includes:
  • the initialization module 301 is used to initialize the Z-axis direction of the fire extinguisher to be a vertical upward direction, and to obtain a unit vector in the vertical direction;
  • the acquisition module 302 when receiving the motion capture data, is used to acquire the unit vector of the Z axis direction of the fire extinguisher in real time, and the motion capture data is used to instruct the upside down operation of the fire extinguisher;
  • the calculation module 303 is used to calculate the included angle between the unit vector in the Z-axis direction of the fire extinguisher and the unit vector in the vertical direction to obtain the included angle value;
  • the update module 304 is configured to update the number of inversions and the accumulation indicator according to the included angle value, the minimum threshold and the maximum threshold, and the accumulation indicator is used to indicate whether to update the number of inversions;
  • the determining module 305 is used to determine that the dry powder in the fire extinguisher has been loosened when the number of inversions is greater than or equal to the preset number of successful inversions and the included angle value is less than or equal to the minimum threshold.
  • the obtaining module 302 may also be specifically used for:
  • the unit vector in the Z-axis direction of the fire extinguisher is calculated in real time according to the preset function, and the motion capture data is used to instruct the fire extinguisher to operate upside down.
  • calculation module 303 may also be specifically used for:
  • the update module 304 includes:
  • the judging unit 3041 is used to judge whether the included angle value is greater than the minimum threshold
  • the setting unit 3042 if the included angle value is less than or equal to the minimum threshold, is used to set the accumulation flag to be logically true, and the accumulation flag is used to indicate whether to update the number of inversions;
  • the updating unit 3043 is configured to update the number of inversions according to the included angle value, the maximum threshold value and the accumulation identifier if the included angle value is greater than the minimum threshold value.
  • the updating unit 3043 is specifically configured to:
  • the judging subunit 30431 if the included angle value is greater than the minimum threshold, is used to determine whether the included angle value is less than the maximum threshold;
  • the operation sub-unit 30432 if the included angle value is less than the maximum threshold, is used to continue the upside-down operation of the fire extinguisher;
  • the update sub-unit 30433 if the included angle value is greater than or equal to the maximum threshold, is used to update the number of inversions according to the accumulation identifier.
  • the update subunit 30433 may also be specifically used for:
  • the accumulation flag is logically true, then obtain the number of inversions, and add 1 to the number of inversions.
  • the initial value of the number of inversions is 0;
  • the device for simulating the loose powder of the fire extinguisher also includes:
  • the reset module 306 is used to reset the number of inversions to 0 when the game end instruction is detected during the upside down of the fire extinguisher.
  • the upside-down operation of the fire extinguisher in the game scene is controlled by two handles, the angle between the Z-axis direction of the fire extinguisher and the vertical direction is calculated in real time, and the number of times the fire extinguisher has been inverted is counted according to the angle value.
  • the user can correctly use the dry powder fire extinguisher to loosen the dry powder by simulating the virtual scene, and improve the fire extinguishing efficiency in the real fire scene.
  • Fig. 5 is a schematic structural diagram of a device for simulating dry powder loosening of a fire extinguisher provided by an embodiment of the present invention.
  • the device 500 for simulating dry powder loosening of a fire extinguisher may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (for example, one or more processors) and memory 520, one or more storage media 530 (for example, one or one storage device with a large amount of storage) storing application programs 533 or data 532.
  • the memory 520 and the storage medium 530 may be short-term storage or persistent storage.
  • the program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of command operations in the device 500 for loosening dry powder of a simulated fire extinguisher.
  • the processor 510 may be configured to communicate with the storage medium 530, and execute a series of instruction operations in the storage medium 530 on the device 500 that simulates the loose powder of a fire extinguisher.
  • the device 500 for simulating the loose powder of a fire extinguisher may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and/or one or more operating systems 531, for example Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc.
  • operating systems 531 for example Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc.
  • FIG. 5 does not constitute a limitation on the simulated fire extinguisher loosening dry powder equipment, and may include more or less components than shown in the figure, or a combination of certain components , Or different component arrangements.
  • the present invention also provides a computer-readable storage medium.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium, and the computer-readable storage medium may also be a volatile computer-readable storage medium.
  • the computer-readable storage medium stores instructions, and when the instructions are run on a computer, the computer executes the steps of the method for loosening dry powder of the simulated fire extinguisher.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present invention essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium.
  • a computer device which can be a personal computer, a server, or a network device, etc.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disks or optical disks and other media that can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Fire-Extinguishing By Fire Departments, And Fire-Extinguishing Equipment And Control Thereof (AREA)

Abstract

一种仿真灭火器松动干粉的方法,涉及运动捕捉领域,用于提高真实场景的灭火效率。方法包括:101、初始化灭火器的Z轴方向为竖直向上的方向,并获取竖直方向的单位向量;102、当接收到动捕数据时,实时获取灭火器的Z轴方向的单位向量,动捕数据用于指示对灭火器进行上下颠倒操作;103、对灭火器的Z轴方向的单位向量和竖直方向的单位向量进行夹角计算,得到夹角值;104、根据夹角值、最小阈值和最大阈值更新已颠倒次数和累加标识;105、当已颠倒次数大于或者等于预设的成功颠倒次数,并且夹角值小于或者等于最小阈值时,确定灭火器中的干粉已完成松动。此外,还公开了一种执行该方法的装置、设备及存储介质。

Description

仿真灭火器松动干粉的方法、装置、设备及存储介质 技术领域
本发明涉及运动捕捉领域,尤其涉及一种仿真灭火器松动干粉的方法、装置、设备及存储介质。
背景技术
干粉灭火器在使用之前,需要让干粉灭火器里面的干粉充分松动,才可以将干粉灭火器用于灭火处理,而采用虚拟场景模拟干粉灭火器松动干粉的过程,使人们能加深使用干粉灭火器的印象,并能在遇到危险时正确地使用干粉灭火器。
在现有技术中,采用将灭火器依附到应用动捕系统的手柄上,手柄移动带动灭火器移动,通过计算灭火器的当前帧和上一帧的位置差,并除以从上一帧移动到当前帧所消耗的时长,得到灭火器移动的实时速度,如果速度超过阈值,则可以进行计时,如果速度低于阈值,则重置计时,得到时长,如果时长达到阈值,则说明灭火器里的干粉已成功松动,可以进入下一步操作。但是该仿真并不符合灭火器的操作的正确性,导致用户在面对真实火灾现场时灭火效率较低。
发明内容
本发明的主要目的在于解决模拟干粉灭火器的干粉松动操作存在正确性较低,导致用户在面对真实火灾现场时灭火效率较低的问题。
本发明第一方面提供了一种仿真灭火器松动干粉的方法,包括:初始化灭火器的Z轴方向为竖直向上的方向,并获取竖直方向的单位向量;当接收到动捕数据时,实时获取所述灭火器的Z轴方向的单位向量,所述动捕数据用于指示对所述灭火器进行上下颠倒操作;对所述灭火器的Z轴方向的单位向量和竖直方向的单位向量进行夹角计算,得到夹角值;根据所述夹角值、最小阈值和最大阈值更新已颠倒次数和累加标识,所述累加标识用于指示是否对所述已颠倒次数进行次数更新;当所述已颠倒次数大于或者等于预设的成功颠倒次数,并且所述夹角值小于所述最小阈值时,确定所述灭火器中的 干粉已完成松动。
可选的,在本发明第一方面的第一种实现方式中,所述当接收到动捕数据时,实时获取所述灭火器的Z轴方向的单位向量,所述动捕数据用于指示对所述灭火器进行上下颠倒操作,包括:当接收到动捕数据时,根据预置函数实时计算所述灭火器的Z轴方向的单位向量,所述动捕数据用于指示对所述灭火器进行上下颠倒操作。
可选的,在本发明第一方面的第二种实现方式中,所述对所述灭火器的Z轴方向的单位向量和所述竖直方向的单位向量进行夹角计算,得到夹角值,包括:根据预置夹角公式对所述灭火器Z轴方向的单位向量a和所述竖直方向的单位向量b进行计算,得到夹角值θ,所述预置夹角公式为:θ=a cos(a·b)。
可选的,在本发明第一方面的第三种实现方式中,所述根据所述夹角值、最小阈值和最大阈值更新已颠倒次数和累加标识,所述累加标识用于指示是否对所述已颠倒次数进行次数更新,包括:判断所述夹角值是否大于最小阈值;若所述夹角值小于或者等于所述最小阈值,则设置累加标识为逻辑真,所述累加标识用于指示是否对所述已颠倒次数进行次数更新;若所述夹角值大于所述最小阈值,则根据所述夹角值、所述最大阈值和所述累加标识对所述已颠倒次数进行更新。
可选的,在本发明第一方面的第四种实现方式中,所述若所述夹角值大于所述最小阈值,则根据所述夹角值、所述最大阈值和所述累加标识对所述已颠倒次数进行更新,包括:若所述夹角值大于所述最小阈值,则判断所述夹角值是否小于所述最大阈值;若所述夹角值小于所述最大阈值,则继续对所述灭火器进行上下颠倒操作;若所述夹角值大于或者等于所述最大阈值,则根据所述累加标识对所述已颠倒次数进行更新。
可选的,在本发明第一方面的第五种实现方式中,所述若所述夹角值大于或者等于所述最大阈值,则根据所述累加标识对所述已颠倒次数进行更新,包括:若所述夹角值大于或者等于所述最大阈值,则判断所述累加标识是否为所述逻辑真;若所述累加标识为所述逻辑真,则获取所述已颠倒次数,并对所述已颠倒次数进行加1计算,所述已颠倒次数的初始值为0;将所述累加标识设置为逻辑假。
可选的,在本发明第一方面的第六种实现方式中,在所述当所述已颠倒 次数大于或者等于预设的成功颠倒次数,并且所述夹角值小于或者等于所述最小阈值时,确定所述灭火器中的干粉已完成松动之后,所述仿真灭火器松动干粉的方法还包括:当在所述灭火器上下颠倒的过程中检测到游戏结束指令时,将所述已颠倒次数设置为0。
本发明第二方面提供了一种仿真灭火器松动干粉的装置,包括:初始化模块,用于初始化灭火器的Z轴方向为竖直向上的方向,并获取竖直方向的单位向量;获取模块,当接收到动捕数据时,用于实时获取所述灭火器的Z轴方向的单位向量,所述动捕数据用于指示对所述灭火器进行上下颠倒操作;计算模块,用于对所述灭火器的Z轴方向的单位向量和所述竖直方向的单位向量进行夹角计算,得到夹角值;更新模块,用于根据所述夹角值、最小阈值和最大阈值更新已颠倒次数和累加标识,所述累加标识用于指示是否对所述已颠倒次数进行次数更新;确定模块,当所述已颠倒次数大于或者等于预设的成功颠倒次数,并且所述夹角值小于或者等于所述最小阈值时,用于确定所述灭火器中的干粉已完成松动。
可选的,在本发明第二方面的第一种实现方式中,所述获取模块具体用于:当接收到动捕数据时,根据预置函数实时计算所述灭火器的Z轴方向的单位向量,所述动捕数据用于指示对所述灭火器进行上下颠倒操作。
可选的,在本发明第二方面的第二种实现方式中,所述计算模块具体用于:根据预置夹角公式对所述灭火器Z轴方向的单位向量a和所述竖直方向的单位向量b进行计算,得到夹角值θ,所述预置夹角公式为:θ=a cos(a·b)。
可选的,在本发明第二方面的第三种实现方式中,所述更新模块包括:判断单元,用于判断所述夹角值是否大于最小阈值;设置单元,若所述夹角值小于或者等于所述最小阈值,则用于设置累加标识为逻辑真,所述累加标识用于指示是否对所述已颠倒次数进行次数更新;更新单元,用于若所述夹角值大于所述最小阈值,则用于根据所述夹角值、所述最大阈值和所述累加标识对所述已颠倒次数进行更新。
可选的,在本发明第二方面的第四种实现方式中,所述更新单元包括:判断子单元,若所述夹角值大于所述最小阈值,则用于判断所述夹角值是否小于所述最大阈值;操作子单元,若所述夹角值小于所述最大阈值,则用于继续对所述灭火器进行上下颠倒操作;更新子单元,若所述夹角值大于或者 等于所述最大阈值,则用于根据所述累加标识对所述已颠倒次数进行更新。
可选的,在本发明第二方面的第五种实现方式中,所述更新子单元具体用于:若所述夹角值大于或者等于所述最大阈值,则判断所述累加标识是否为所述逻辑真;若所述累加标识为所述逻辑真,则获取所述已颠倒次数,并对所述已颠倒次数进行加1计算,所述已颠倒次数的初始值为0;将所述累加标识设置为逻辑假。
可选的,在本发明第二方面的第六种实现方式中,所述仿真灭火器松动干粉的装置还包括:重置模块,当在所述灭火器上下颠倒的过程中检测到游戏结束指令时,用于将所述已颠倒次数重置为0。
本发明第三方面提供了一种仿真灭火器松动干粉的设备,包括:存储器和至少一个处理器,所述存储器中存储有指令,所述存储器和所述至少一个处理器通过线路互连;所述至少一个处理器调用所述存储器中的所述指令,以使得所述仿真灭火器松动干粉的设备执行上述的仿真灭火器松动干粉的方法。
本发明的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述的仿真灭火器松动干粉的方法。
本发明提供的技术方案中,初始化灭火器的Z轴方向为竖直向上的方向,并获取竖直方向的单位向量;当接收到动捕数据时,实时获取所述灭火器的Z轴方向的单位向量,所述动捕数据用于指示对所述灭火器进行上下颠倒操作;对所述灭火器的Z轴方向的单位向量和竖直方向的单位向量进行夹角计算,得到夹角值;根据所述夹角值、最小阈值和最大阈值更新已颠倒次数和累加标识,所述累加标识用于指示是否对所述已颠倒次数进行次数更新;当所述已颠倒次数大于或者等于预设的成功颠倒次数,并且所述夹角值小于所述最小阈值时,确定所述灭火器中的干粉已完成松动。本发明实施例中,通过两只手柄控制游戏场景中灭火器的上下颠倒操作,实时计算灭火器的Z轴方向和竖直向上之间的夹角值,并根据夹角值统计灭火器的已颠倒次数,直到灭火器内干粉已完成松动,通过模拟虚拟场景使得用户能正确使用干粉灭火器松动干粉,并提高真实火灾现场中的灭火效率。
附图说明
图1为本发明实施例中仿真灭火器松动干粉的方法的一个实施例示意图;
图2为本发明实施例中仿真灭火器松动干粉的方法的另一个实施例示意图;
图3为本发明实施例中仿真灭火器松动干粉的装置的一个实施例示意图;
图4为本发明实施例中仿真灭火器松动干粉的装置的另一个实施例示意图;
图5为本发明实施例中仿真灭火器松动干粉的设备的一个实施例示意图。
具体实施方式
本发明实施例提供了一种仿真灭火器松动干粉的方法、装置、设备及存储介质,通过两只手柄控制游戏场景中灭火器的上下颠倒操作,实时计算灭火器的Z轴方向和竖直向上之间的夹角值,并根据夹角值统计灭火器的已颠倒次数,直到灭火器内干粉已完成松动,通过模拟虚拟场景使得用户能正确使用干粉灭火器松动干粉,并提高真实火灾现场中的灭火效率。
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”或“具有”及其任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
为便于理解,下面对本发明实施例的具体流程进行描述,请参阅图1,本发明实施例中仿真灭火器松动干粉的方法的一个实施例包括:
101、初始化灭火器的Z轴方向为竖直向上的方向,并获取竖直方向的单位向量。
其中,单位向量是指模等于1的向量,单位向量是非零向量,并且具有确定的方向,因此,服务器从竖直方向中采集对应的模为1的向量,得到竖直方向的单位向量。
需要说明的是,在虚拟场景中,初始化灭火器的Z轴方向为竖直向上的 方向,也就是灭火器的Z轴方向的初始状态与竖直方向保持一致。当一个物体只处于“上-下”方向排成直线时,被称为竖直方向,也就是与地平线或水平线垂直,进一步地,服务器将地面的大地坐标系的z轴作为竖直方向,灭火器为干粉灭火器。
可以理解的是,本发明的执行主体可以为仿真灭火器松动干粉的装置,还可以是终端或者服务器,具体此处不做限定。本发明实施例以服务器为执行主体为例进行说明。
102、当接收到动捕数据时,实时获取灭火器的Z轴方向的单位向量,动捕数据用于指示对灭火器进行上下颠倒操作。
其中,动捕数据为运动捕捉系统实时采集的数据,运动捕捉的实质就是要测量、跟踪和记录物体在三维空间中的运动轨迹。灭火器在上下颠倒操作中,灭火器的Z轴方向也会随着灭火器的运动方向实时变化,因此服务器实时从灭火器的Z轴方向中采集模为1的向量,得到灭火器的Z轴方向的单位向量。
需要说明的是,对灭火器执行上下颠倒操作,采用两只手将灭火器上下翻转,也就是,用户左右手各拿一只动作捕捉的手柄,两个手柄上都预先绑上动捕数据的刚体,即手柄在真实场景中的位置可应用到虚幻4的世界中,将灭火器的把手依附到一只手柄上,另一只手柄触碰到灭火器的底部,当任意一只手柄在实际场景中画圆到达另一只手柄处,将带动虚拟场景中灭火器进行上下颠倒操作,直到灭火器中干粉已完全松动,就可进入下一步对灭火器的使用操作。
103、对灭火器的Z轴方向的单位向量和竖直方向的单位向量进行夹角计算,得到夹角值。
具体的,服务器对灭火器的Z轴方向的单位向量进行取模运算,得到第一模值;服务器对竖直方向的单位向量进行取模运算,得到第二模值;服务器根据第一模值与第二模值进行乘法运算,得到第一运算结果;服务器对灭火器的Z轴方向的单位向量和竖直方向的单位向量进行乘积运算,得到第二运算结果,第二运算结果为1;服务器对灭火器的Z轴方向的单位向量和竖直方向的单位向量进行乘法运算,得到初始向量积;服务器将初始向量积除以第二运算结果,得到目标向量积,服务器根据反余弦函数对目标向量积进行 计算,得到夹角值。
104、根据夹角值、最小阈值和最大阈值更新已颠倒次数和累加标识,累加标识用于指示是否对已颠倒次数进行次数更新。
在灭火器在上下颠倒操作过程中,当夹角值小于最小阈值时,服务器设置累加次数为第一目标值,累加标识用于指示是否对已颠倒次数进行次数更新;当夹角值大于或者等于最小阈值,并且夹角值小于最大阈值时,服务器继续执行颠倒操作;当夹角值大于或者等于最大阈值,并且累加标识为第一目标值时,对已颠倒次数进行加1操作,已颠倒次数为大于或者等于0的整数,同时将累加标识设置为第二目标值。例如,最小阈值为5度,最大阈值为176度,夹角值的取值区间大于或者等于0度,并且小于或者等于180度。
需要说明的是,第一目标值用于指示逻辑真,第二目标值用于指示逻辑假。当灭火器的Z轴方向从竖直向上的方向旋转移动到从竖直向下的方向时,对已颠倒次数累加一次,当灭火器的Z轴方向从竖直向下的方向向竖直向下的方向旋转移动时,即使存在夹角值大于或者等于最大阈值的情况,但是由于累加标识为第二目标值,服务器也不会重复统计已颠倒次数,确保已颠倒次数的正确性。
105、当已颠倒次数大于或者等于预设的成功颠倒次数,并且夹角值小于或者等于最小阈值时,确定灭火器中的干粉已完成松动。
服务器重复执行步骤102至步骤104,直到已颠倒次数大于或者等于预设的成功颠倒次数时,服务器判断夹角值是否小于或者等于最小阈值,若夹角值大于最小阈值,则将灭火器的Z轴方向旋转移动到竖直向上的方向;若夹角值小于或者等于最小阈值,则确定灭火器中的干粉已完成松动,可以对灭火器进行其他操作。例如,当预设的成功颠倒次数为10,已颠倒次数为11,并且夹角值小于最小阈值,则服务器灭火器中的干粉已完成松动。
可以理解的是,对灭火器进行上下颠倒操作,也可以应用到教学或消防演练中,使得人们能够对灭火器进行正确的操作,采用上下颠倒方式让灭火器中的干粉充分松动,达到较好的灭火效果。
本发明实施例中,通过两只手柄控制游戏场景中灭火器的上下颠倒操作,实时计算灭火器的Z轴方向和竖直向上之间的夹角值,并根据夹角值统计灭火器的已颠倒次数,直到灭火器内干粉已完成松动,通过模拟虚拟场景使得 用户能正确使用干粉灭火器松动干粉,并提高真实火灾现场中的灭火效率。
请参阅图2,本发明实施例中仿真灭火器松动干粉的方法的另一个实施例包括:
201、初始化灭火器的Z轴方向为竖直向上的方向,并获取竖直方向的单位向量。
服务器初始化灭火器的Z轴方向为竖直向上的方向,也就是初始状态时,灭火器的Z轴方向与竖直方向的方向一致,但在灭火器上下颠倒操作过程中,灭火器的Z轴方向是实时变化的。服务器可以获取模为1的竖直方向的向量作为竖直方向的单位向量,也可以获取一个竖直方向的非零向量,并将该非零向量除以该非零向量的模,得到竖直方向的单位向量,具体此处不做限定。
202、当接收到动捕数据时,根据预置函数实时计算灭火器的Z轴方向的单位向量,动捕数据用于指示对灭火器进行上下颠倒操作。
在控制灭火器上下颠倒操作之前,首先将两个手柄绑上动捕数据的刚体,实现两个手柄与灭火器的虚拟互连,两个手柄上的动作捕捉传感器实时采集各自对应的运动过程,服务器根据两个手柄的动捕数据实现对灭火器的虚拟操作,确保游戏场景中的手柄和真实场景中的手柄位置旋转同步。进一步地,在一个手柄上采用用户界面提示用户使用该手柄触碰灭火器,并按住中指键,使灭火器依附到该手柄上,此时另一个手柄上采用用户界面提示用户使用这个手柄触碰到灭火器底部区域,并按住中指键,此时对灭火器进行上下颠倒操作,并开始颠倒灭火器的计算。
具体的,当接收到动捕数据时,服务器根据预置函数实时计算灭火器的Z轴方向的单位向量,动捕数据用于指示对灭火器进行上下颠倒操作,其中,预置函数可以为虚幻游戏中的获取向量函数GetActorUpVector()。
可以理解的是,利用运动捕捉技术捕捉用户的各种动作,驱动虚拟环境中颠倒动作,能够给用户以一种全新的参与感受,加强对灭火器正确使用方式的真实感和互动性。
203、根据预置夹角公式对灭火器Z轴方向的单位向量和竖直方向的单位向量进行计算,得到夹角值。
进一步地,设置灭火器Z轴方向的单位向量a,竖直方向的单位向量b,预置夹角公式为θ=a cos(a·b),将a和b代入θ=a cos(a·b)进行计算,得到夹角值 θ。其中,夹角值为当前帧的灭火器的夹角值,由于灭火器的Z轴方向随着上下颠倒操作一直在变化,因为服务器需要实时计算当前帧的灭火器的夹角值。
需要说明的是,两个向量的夹角的余弦函数公式为
Figure PCTCN2021077224-appb-000001
那么对应的反余弦函数公式为
Figure PCTCN2021077224-appb-000002
若将向量c和d转化为对应的单位向量a和单位向量b,也就是模为1的向量,则可以确定最终的夹角值计算公式为θ=a cos(a·b),也就是预置夹角公式,服务器通过该预置夹角公式计算得到当前帧的灭火器Z轴方向与竖直方向的夹角值。
204、判断夹角值是否大于最小阈值。
具体的,服务器获取最小阈值;服务器将夹角值与最小阈值进行差运算,得到运算结果;服务器判断运算结果是否大于0;若夹角值大于0,则服务器确定夹角值大于最小阈值;若运算结果小于或者等于0,则服务器确定夹角值小于或者等于最小阈值。
举例说明,服务器设置最小阈值为13度,若夹角值为20度,则服务器确定夹角值大于最小阈值;若夹角值为6度或者13度,则服务器确定夹角值小于或者等于最小阈值。
205、若夹角值小于或者等于最小阈值,则设置累加标识为逻辑真,累加标识用于指示是否对已颠倒次数进行次数更新。
若夹角值小于或者等于最小阈值,则服务器确定灭火器在上下颠倒操作过程中,灭火器的Z轴方向还未从竖直向上的方向旋转移动到竖直向下的方向,或者灭火器的Z轴方向从竖直向下的方向重新向竖直向上的方向旋转移动,则服务器累加标识为逻辑真,逻辑真用于指示服务器能够对已颠倒次数进行次数更新。其中,已颠倒次数用于统计将灭火器成功上下颠倒测次数,对该已颠倒次数进行更新的限制条件就是服务器确定累加标识为逻辑真时,才可以更新已颠倒次数。
可以理解的是,累加标识为布尔型变量,布尔型变量是指具有两种逻辑状态的变量,也就是逻辑真和逻辑假。可以采用1或者0表示累加标识的逻辑真或者逻辑假,也可以采用true或者false表示累加标识的逻辑真或者逻辑假,具体此处不做限定。
206、若夹角值大于最小阈值,则根据夹角值、最大阈值和累加标识对已颠倒次数进行更新。
其中,最大阈值用于指示灭火器的Z轴方向从竖直向上的方向旋转移动到竖直向下的方向中,例如,设置最大阈值为170度。可以理解的是,服务器将上下颠倒的区域划分为夹角值小于或者等于最小阈值的第一颠倒区域、夹角值大于最小阈值并且夹角值小于最大阈值的第二颠倒区域、以及夹角值大于或者等于最大阈值的第三颠倒区域。具体的,若夹角值大于最小阈值,则服务器判断夹角值是否小于最大阈值;若夹角值小于最大阈值,则继续对灭火器进行上下颠倒操作;若夹角值大于或者等于最大阈值,则服务器根据累加标识对已颠倒次数进行更新,进一步地,若夹角值大于最小阈值,则判断夹角值是否小于最大阈值;若夹角值小于最大阈值,则继续对灭火器进行上下颠倒操作;若夹角值大于或者等于最大阈值,则根服务器据累加标识对已颠倒次数进行更新,进一步地,若所述夹角值大于或者等于所述最大阈值,则服务器判断所述累加标识是否为所述逻辑真;若所述累加标识为所述逻辑真,则服务器获取所述已颠倒次数,并对所述已颠倒次数进行加1计算,所述已颠倒次数的初始值为0,例如,已颠倒次数为3,再次对灭火器成功上下颠倒一次,则已颠倒次数为4;服务器将所述累加标识设置为逻辑假。
需要说明的是,当灭火器的Z轴方向处于第一颠倒区域时,服务器将累加标识设置为逻辑真;当灭火器的Z轴方向处于第三颠倒区域时,服务器将累加标识设置为逻辑假,此时,服务器受条件约束,不能对已颠倒次数进行次数更新,防止存在一次颠倒成功,多次更新已颠倒次数,导致统计成功对灭火器进行上下颠倒的次数不准确的问题。
207、当已颠倒次数大于或者等于预设的成功颠倒次数,并且夹角值小于或者等于最小阈值时,确定灭火器中的干粉已完成松动。
具体的,服务器判断已颠倒次数是否小于预设的成功颠倒次数;若已颠倒次数小于预设的成功颠倒次数,则服务器继续执行步骤202至206;若已颠倒次数大于或者等于预设的成功颠倒次数,则服务器判断夹角值是否大于最小阈值;若夹角值大于最小阈值,则服务器继续执行步骤202至206;若夹角值小于或者等于最小阈值,则灭火器的Z轴方向为竖直向上的方向,此时,灭火器处于正立抓举的状态,即可视为灭火器已完成上下颠倒,灭火器内干粉已完成松动,灭火器可以进入下一步使用操作。
可选的,在灭火器上下颠倒的过程中,若用户松开中指键,则服务器接 收到接收游戏结束指令,灭火器将掉落在虚拟场景中的地面上,此时将已颠倒次数重新设置为0,若游戏需重新进行上述计算。
本发明实施例中,通过两只手柄控制游戏场景中灭火器的上下颠倒操作,实时计算灭火器的Z轴方向和竖直向上之间的夹角值,并根据夹角值统计灭火器的已颠倒次数,直到灭火器内干粉已完成松动,通过模拟虚拟场景使得用户能正确使用干粉灭火器松动干粉,并提高真实火灾现场中的灭火效率。
上面对本发明实施例中仿真灭火器松动干粉的方法进行了描述,下面对本发明实施例中仿真灭火器松动干粉的装置进行描述,请参阅图3,本发明实施例中仿真灭火器松动干粉的装置一个实施例包括:
初始化模块301,用于初始化灭火器的Z轴方向为竖直向上的方向,并获取竖直方向的单位向量;
获取模块302,当接收到动捕数据时,用于实时获取灭火器的Z轴方向的单位向量,动捕数据用于指示对灭火器进行上下颠倒操作;
计算模块303,用于对灭火器的Z轴方向的单位向量和竖直方向的单位向量进行夹角计算,得到夹角值;
更新模块304,用于根据夹角值、最小阈值和最大阈值更新已颠倒次数和累加标识,累加标识用于指示是否对已颠倒次数进行次数更新;
确定模块305,当已颠倒次数大于或者等于预设的成功颠倒次数,并且夹角值小于或者等于最小阈值时,用于确定灭火器中的干粉已完成松动。
本发明实施例中,通过两只手柄控制游戏场景中灭火器的上下颠倒操作,实时计算灭火器的Z轴方向和竖直向上之间的夹角值,并根据夹角值统计灭火器的已颠倒次数,直到灭火器内干粉已完成松动,通过模拟虚拟场景使得用户能正确使用干粉灭火器松动干粉,并提高真实火灾现场中的灭火效率。
请参阅图4,本发明实施例中仿真灭火器松动干粉的装置的另一个实施例包括:
初始化模块301,用于初始化灭火器的Z轴方向为竖直向上的方向,并获取竖直方向的单位向量;
获取模块302,当接收到动捕数据时,用于实时获取灭火器的Z轴方向的单位向量,动捕数据用于指示对灭火器进行上下颠倒操作;
计算模块303,用于对灭火器的Z轴方向的单位向量和竖直方向的单位向 量进行夹角计算,得到夹角值;
更新模块304,用于根据夹角值、最小阈值和最大阈值更新已颠倒次数和累加标识,累加标识用于指示是否对已颠倒次数进行次数更新;
确定模块305,当已颠倒次数大于或者等于预设的成功颠倒次数,并且夹角值小于或者等于最小阈值时,用于确定灭火器中的干粉已完成松动。
可选的,获取模块302还可以具体用于:
当接收到动捕数据时,根据预置函数实时计算灭火器的Z轴方向的单位向量,动捕数据用于指示对灭火器进行上下颠倒操作。
可选的,计算模块303还可以具体用于:
根据预置夹角公式对灭火器Z轴方向的单位向量a和竖直方向的单位向量b进行计算,得到夹角值θ,预置夹角公式为:θ=a cos(a·b)。
可选的,更新模块304包括:
判断单元3041,用于判断夹角值是否大于最小阈值;
设置单元3042,若夹角值小于或者等于最小阈值,则用于设置累加标识为逻辑真,累加标识用于指示是否对已颠倒次数进行次数更新;
更新单元3043,用于若夹角值大于最小阈值,则用于根据夹角值、最大阈值和累加标识对已颠倒次数进行更新。
可选的,更新单元3043具体用于:
判断子单元30431,若夹角值大于最小阈值,则用于判断夹角值是否小于最大阈值;
操作子单元30432,若夹角值小于最大阈值,则用于继续对灭火器进行上下颠倒操作;
更新子单元30433,若夹角值大于或者等于最大阈值,则用于根据累加标识对已颠倒次数进行更新。
可选的,更新子单元30433还可以具体用于:
若夹角值大于或者等于最大阈值,则判断累加标识是否为逻辑真;
若累加标识为逻辑真,则获取已颠倒次数,并对已颠倒次数进行加1计算,已颠倒次数的初始值为0;
将累加标识设置为逻辑假。
可选的,仿真灭火器松动干粉的装置还包括:
重置模块306,当在灭火器上下颠倒的过程中检测到游戏结束指令时,用于将已颠倒次数重置为0。
本发明实施例中,通过两只手柄控制游戏场景中灭火器的上下颠倒操作,实时计算灭火器的Z轴方向和竖直向上之间的夹角值,并根据夹角值统计灭火器的已颠倒次数,直到灭火器内干粉已完成松动,通过模拟虚拟场景使得用户能正确使用干粉灭火器松动干粉,并提高真实火灾现场中的灭火效率。
上面图3和图4从模块化功能实体的角度对本发明实施例中的仿真灭火器松动干粉的装置进行详细描述,下面从硬件处理的角度对本发明实施例中仿真灭火器松动干粉的设备进行详细描述。
图5是本发明实施例提供的一种仿真灭火器松动干粉的设备的结构示意图,该仿真灭火器松动干粉的设备500可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器(central processing units,CPU)510(例如,一个或一个以上处理器)和存储器520,一个或一个以上存储应用程序533或数据532的存储介质530(例如一个或一个以上海量存储设备)。其中,存储器520和存储介质530可以是短暂存储或持久存储。存储在存储介质530的程序可以包括一个或一个以上模块(图示没标出),每个模块可以包括对仿真灭火器松动干粉的设备500中的一系列指令操作。更进一步地,处理器510可以设置为与存储介质530通信,在仿真灭火器松动干粉的设备500上执行存储介质530中的一系列指令操作。
仿真灭火器松动干粉的设备500还可以包括一个或一个以上电源540,一个或一个以上有线或无线网络接口550,一个或一个以上输入输出接口560,和/或,一个或一个以上操作系统531,例如Windows Serve,Mac OS X,Unix,Linux,FreeBSD等等。本领域技术人员可以理解,图5示出的仿真灭火器松动干粉的设备结构并不构成对仿真灭火器松动干粉的设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
本发明还提供一种计算机可读存储介质,该计算机可读存储介质可以为非易失性计算机可读存储介质,该计算机可读存储介质也可以为易失性计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在计算机上运行时,使得计算机执行所述仿真灭火器松动干粉的方法的步骤。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描 述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (10)

  1. 一种仿真灭火器松动干粉的方法,其特征在于,所述仿真灭火器松动干粉的方法包括:
    初始化灭火器的Z轴方向为竖直向上的方向,并获取竖直方向的单位向量;
    当接收到动捕数据时,实时获取所述灭火器的Z轴方向的单位向量,所述动捕数据用于指示对所述灭火器进行上下颠倒操作;
    对所述灭火器的Z轴方向的单位向量和所述竖直方向的单位向量进行夹角计算,得到夹角值;
    根据所述夹角值、最小阈值和最大阈值更新已颠倒次数和累加标识,所述累加标识用于指示是否对所述已颠倒次数进行次数更新;
    当所述已颠倒次数大于或者等于预设的成功颠倒次数,并且所述夹角值小于或者等于所述最小阈值时,确定所述灭火器中的干粉已完成松动。
  2. 根据权利要求1所述的仿真灭火器松动干粉的方法,其特征在于,所述当接收到动捕数据时,实时获取所述灭火器的Z轴方向的单位向量,所述动捕数据用于指示对所述灭火器进行上下颠倒操作,包括:
    当接收到动捕数据时,根据预置函数实时计算所述灭火器的Z轴方向的单位向量,所述动捕数据用于指示对所述灭火器进行上下颠倒操作。
  3. 根据权利要求1所述的仿真灭火器松动干粉的方法,其特征在于,所述对所述灭火器的Z轴方向的单位向量和所述竖直方向的单位向量进行夹角计算,得到夹角值,包括:
    根据预置夹角公式对所述灭火器Z轴方向的单位向量a和所述竖直方向的单位向量b进行计算,得到夹角值θ,所述预置夹角公式为:
    θ=a cos(a·b)。
  4. 根据权利要求1所述的仿真灭火器松动干粉的方法,其特征在于,所述根据所述夹角值、最小阈值和最大阈值更新已颠倒次数和累加标识,所述累加标识用于指示是否对所述已颠倒次数进行次数更新,包括:
    判断所述夹角值是否大于最小阈值;
    若所述夹角值小于或者等于所述最小阈值,则设置累加标识为逻辑真,所述累加标识用于指示是否对所述已颠倒次数进行次数更新;
    若所述夹角值大于所述最小阈值,则根据所述夹角值、所述最大阈值和所述累加标识对所述已颠倒次数进行更新。
  5. 根据权利要求4所述的仿真灭火器松动干粉的方法,其特征在于,所述若所述夹角值大于所述最小阈值,则根据所述夹角值、所述最大阈值和所述累加标识对所述已颠倒次数进行更新,包括:
    若所述夹角值大于所述最小阈值,则判断所述夹角值是否小于所述最大阈值;
    若所述夹角值小于所述最大阈值,则继续对所述灭火器进行上下颠倒操作;
    若所述夹角值大于或者等于所述最大阈值,则根据所述累加标识对所述已颠倒次数进行更新。
  6. 根据权利要求5所述的仿真灭火器松动干粉的方法,其特征在于,所述若所述夹角值大于或者等于所述最大阈值,则根据所述累加标识对所述已颠倒次数进行更新,包括:
    若所述夹角值大于或者等于所述最大阈值,则判断所述累加标识是否为所述逻辑真;
    若所述累加标识为所述逻辑真,则获取所述已颠倒次数,并对所述已颠倒次数进行加1计算,所述已颠倒次数的初始值为0;
    将所述累加标识设置为逻辑假。
  7. 根据权利要求1-6中任一项所述的仿真灭火器松动干粉的方法,其特征在于,在所述当所述已颠倒次数大于或者等于预设的成功颠倒次数,并且所述夹角值小于或者等于所述最小阈值时,确定所述灭火器中的干粉已完成松动之后,所述仿真灭火器松动干粉的方法还包括:
    当在所述灭火器上下颠倒的过程中检测到游戏结束指令时,将所述已颠 倒次数设置为0。
  8. 一种仿真灭火器松动干粉的装置,其特征在于,所述仿真灭火器松动干粉的装置包括:
    初始化模块,用于初始化灭火器的Z轴方向为竖直向上的方向,并获取竖直方向的单位向量;
    获取模块,当接收到动捕数据时,用于实时获取所述灭火器的Z轴方向的单位向量,所述动捕数据用于指示对所述灭火器进行上下颠倒操作;
    计算模块,用于对所述灭火器的Z轴方向的单位向量和所述竖直方向的单位向量进行夹角计算,得到夹角值;
    更新模块,用于根据所述夹角值、最小阈值和最大阈值更新已颠倒次数和累加标识,所述累加标识用于指示是否对所述已颠倒次数进行次数更新;
    确定模块,当所述已颠倒次数大于或者等于预设的成功颠倒次数,并且所述夹角值小于或者等于所述最小阈值时,用于确定所述灭火器中的干粉已完成松动。
  9. 一种仿真灭火器松动干粉的设备,其特征在于,所述仿真灭火器松动干粉的设备包括:存储器和至少一个处理器,所述存储器中存储有指令,所述存储器和所述至少一个处理器通过线路互连;
    所述至少一个处理器调用所述存储器中的所述指令,以使得所述仿真灭火器松动干粉的设备执行如权利要求1-7中任意一项所述的仿真灭火器松动干粉的方法。
  10. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-7中任一项所述仿真灭火器松动干粉的方法。
PCT/CN2021/077224 2020-02-25 2021-02-22 仿真灭火器松动干粉的方法、装置、设备及存储介质 WO2021169911A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010115405.5 2020-02-25
CN202010115405.5A CN111310347B (zh) 2020-02-25 2020-02-25 仿真灭火器松动干粉的方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021169911A1 true WO2021169911A1 (zh) 2021-09-02

Family

ID=71161919

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/077224 WO2021169911A1 (zh) 2020-02-25 2021-02-22 仿真灭火器松动干粉的方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN111310347B (zh)
WO (1) WO2021169911A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111310347B (zh) * 2020-02-25 2022-05-31 深圳市瑞立视多媒体科技有限公司 仿真灭火器松动干粉的方法、装置、设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150060092A1 (en) * 2013-08-30 2015-03-05 Ametek Ameron, Llc Calibration module and remote test sequence unit for monitoring and dynamically controlling discharge and distribution of a fire suppression agent
CN107067935A (zh) * 2017-04-19 2017-08-18 华南师范大学 一种基于虚拟现实的灭火器教学系统和方法
CN107823831A (zh) * 2017-11-30 2018-03-23 北京神州恒安科技有限公司 一种仿真手提式灭火器
CN111310347A (zh) * 2020-02-25 2020-06-19 深圳市瑞立视多媒体科技有限公司 仿真灭火器松动干粉的方法、装置、设备及存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6500008B1 (en) * 1999-03-15 2002-12-31 Information Decision Technologies, Llc Augmented reality-based firefighter training system and method
US20010047251A1 (en) * 2000-03-03 2001-11-29 Kemp William H. CAD system which designs 3-D models
JP4606208B2 (ja) * 2004-07-27 2011-01-05 プラントエンジニアリング株式会社 流体噴射シミュレーション方法
CN102327687B (zh) * 2011-07-27 2013-04-10 江苏中瑞电保智能装备有限公司 风速调节干粉灭火系统及灭火方法
CN107331234A (zh) * 2017-07-27 2017-11-07 上海粲高教育设备有限公司 一种模拟灭火体验系统
CN110135016A (zh) * 2019-04-26 2019-08-16 南京科谷智能科技有限公司 一种基于神经网络的多维消防数据融合分析方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150060092A1 (en) * 2013-08-30 2015-03-05 Ametek Ameron, Llc Calibration module and remote test sequence unit for monitoring and dynamically controlling discharge and distribution of a fire suppression agent
CN107067935A (zh) * 2017-04-19 2017-08-18 华南师范大学 一种基于虚拟现实的灭火器教学系统和方法
CN107823831A (zh) * 2017-11-30 2018-03-23 北京神州恒安科技有限公司 一种仿真手提式灭火器
CN111310347A (zh) * 2020-02-25 2020-06-19 深圳市瑞立视多媒体科技有限公司 仿真灭火器松动干粉的方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN111310347A (zh) 2020-06-19
CN111310347B (zh) 2022-05-31

Similar Documents

Publication Publication Date Title
US20240058691A1 (en) Method and system for using sensors of a control device for control of a game
US10456653B2 (en) Swing quality measurement system
US7403202B1 (en) Computer animation of simulated characters using combinations of motion-capture data and external force modelling or other physics models
US11833406B2 (en) Swing quality measurement system
US9669300B2 (en) Motion detection for existing portable devices
KR20150005447A (ko) 운동 해석 장치
US20200009453A1 (en) Game client control method and apparatus, storage medium, and electronic apparatus
WO2021169911A1 (zh) 仿真灭火器松动干粉的方法、装置、设备及存储介质
WO2018103656A1 (zh) 一种vr场景下的道具运动处理方法、装置及存储介质
EP3189400A1 (en) Motion detection for portable devices
US11577142B2 (en) Swing analysis system that calculates a rotational profile
CN104587662A (zh) 运动分析装置、运动分析方法
Bai et al. Wrighteagle and UT Austin villa: RoboCup 2011 simulation league champions
WO2023078272A1 (zh) 虚拟对象显示方法、装置、电子设备及可读介质
CN107050848B (zh) 基于体域网的体感游戏实现方法以及装置
CN108392805A (zh) 一种高尔夫球挥杆动作分析方法及智能终端
CN109542210B (zh) 基于虚拟引擎的手臂运动模拟还原方法、存储介质
JP2012247953A (ja) プログラム、情報記憶媒体、情報処理システム及び情報処理方法
CN111905368B (zh) 游戏中虚拟道具控制方法、装置、设备及存储介质
WO2018018616A1 (zh) 一种运动装置
CN118135118B (zh) 三维建模姿态数据处理方法及系统
JP5133380B2 (ja) ゲーム装置、ゲーム装置の制御方法、ならびに、プログラム
WO2023246172A9 (zh) 技能指示器的显示控制方法、装置和电子设备
JP5784985B2 (ja) プログラム、情報記憶媒体、情報処理システム及び情報処理方法
CN113476828A (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: 21761761

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 01/02/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21761761

Country of ref document: EP

Kind code of ref document: A1