Game mold penetration prevention method, device and equipment and storage medium
By calculating the movement direction vector of the hand model and predicting the position data of the next frame, the emitted rays perform collision detection and adjusting the position of the hand model, solving the problems of high computational complexity and insufficient real-time performance in the prior art, and achieving efficient anti-mode-through effect.
Patent Information
- Application Number
- CN202510191355.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-03-28
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing gaming mode-proof technology has high computational complexity and insufficient real-time performance, especially on mobile devices or VR headsets with limited performance, it is difficult to achieve smooth frame rates.
By calculating the movement direction vector of the hand model, predict the position data of the next frame, and perform collision detection based on the data, adjusting the position of the hand model to avoid passing through the mold.
It reduces the computational complexity, improves real-time performance, deals with potential mold penetration situations in advance, improves the efficiency of anti-mode penetration, and avoids complex physical simulation calculations.
Smart Images

Figure CN119718085A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game anti-mold penetration technology, and in particular to a game anti-mold penetration method, device, equipment and storage medium. Background Art
[0002] In virtual reality (VR) and augmented reality (AR) games, the interaction between the user's hand model and objects in the virtual environment is a key function. However, due to the limitations of computer graphics, the hand model often penetrates the virtual objects, which is the so-called "penetration" problem. This penetration phenomenon seriously affects the user's immersion and interactive experience.
[0003] To solve this problem, existing technologies usually use complex physical simulation or post-processing algorithms. For example, some methods use precise collision detection and response algorithms to simulate real-world physical interactions; other methods use depth buffering or occlusion culling techniques to handle the phenomenon of penetration during the rendering stage. However, these methods generally have the problems of large computational complexity and poor real-time performance. Especially on mobile devices or hardware such as VR headsets with limited performance, these complex algorithms often find it difficult to achieve a smooth frame rate, which affects the user experience. Summary of the invention
[0004] The main purpose of the present invention is to solve the technical problems of high computational complexity and insufficient real-time performance of existing game anti-mode penetration technology; A first aspect of the present invention provides a method for preventing game from being penetrated, and the method for preventing game from being penetrated comprises: Calculating a moving direction vector of the hand model according to current frame position data and previous frame position data of the hand model in the virtual environment; Predicting the next frame position data of the hand model according to the moving direction vector and the current frame position data, and emitting rays based on the next frame position data and the moving direction vector; It is determined whether a collision event occurs with the ray in the virtual environment, and when a collision event occurs with the ray, the position of the hand model is adjusted and the model is rendered.
[0005] Optionally, in a first implementation manner of the first aspect of the present invention, calculating the moving direction vector of the hand model according to the current frame position data and the previous frame position data of the hand model in the virtual environment includes: Performing a vector subtraction operation on the current frame position data and the previous frame position data to obtain a movement vector of the hand model; Performing unitization processing on the movement vector to obtain a unit direction vector; The average movement amplitude per frame is calculated according to the unit direction vector to obtain the movement direction vector of the hand model.
[0006] Optionally, in a second implementation of the first aspect of the present invention, predicting the next frame position data of the hand model according to the moving direction vector and the current frame position data, and emitting rays based on the next frame position data and the moving direction vector includes: Performing a vector addition operation according to the moving direction vector, a preset moving speed parameter and the current frame position data to obtain predicted next frame position data; Generate the center point coordinates of the spherical ray according to the predicted next frame position data, and determine the radius of the spherical ray according to the preset hand model size parameters; Ray parameters are constructed based on the center point coordinates, the spherical ray radius and the moving direction vector, and rays are emitted based on the ray parameters.
[0007] Optionally, in a third implementation manner of the first aspect of the present invention, performing a vector addition operation according to the moving direction vector, a preset moving speed parameter, and the current frame position data to obtain the predicted next frame position data includes: Performing vector multiplication operation on the moving direction vector and a preset moving speed parameter to obtain a predicted displacement vector; Performing weighted fusion processing according to the predicted displacement vector and current acceleration data of the hand model to obtain a corrected predicted displacement vector; Performing vector addition operation on the corrected predicted displacement vector and the current frame position data to obtain preliminary predicted next frame position data; Position correction processing is performed according to the initially predicted next frame position data and preset boundary constraints to obtain predicted next frame position data.
[0008] Optionally, in a fourth implementation manner of the first aspect of the present invention, the determining whether a collision event occurs for the ray in the virtual environment, and adjusting the position of the hand model and rendering the model when a collision event occurs for the ray includes: Performing collision detection calculation on the ray and the object in the virtual environment to obtain collision detection result data; Determine whether there is a collision point according to the collision detection result data, and if so, extract the collision point coordinate information; Calculate the maximum movable distance based on the collision point coordinate information and the current frame position data, and adjust the position of the hand model to obtain adjusted position data; The hand model is repositioned and rendered according to the adjusted position data to obtain an anti-penetration hand model image.
[0009] Optionally, in a fifth implementation of the first aspect of the present invention, the maximum movable distance is calculated based on the collision point coordinate information and the current frame position data, and the position of the hand model is adjusted to obtain the adjusted position data, which includes: Performing vector subtraction operation on the collision point coordinate information and the current frame position data to obtain a collision direction vector; Performing a vector scalar multiplication operation according to the collision direction vector and a preset safety distance parameter to obtain a maximum movable vector; Performing a vector addition operation on the maximum movable vector and the current frame position data to obtain adjusted initial position data; Position optimization processing is performed according to the adjusted initial position data and preset hand model joint constraints to obtain adjusted position data.
[0010] Optionally, in a sixth implementation manner of the first aspect of the present invention, performing collision detection calculation on the ray and the object in the virtual environment to obtain collision detection result data includes: Collecting and analyzing the acceleration data and angular velocity data of the hand model to obtain hand motion state parameters; performing a comparison operation on a preset detection threshold according to the hand motion state parameter, and dynamically adjusting the ray detection parameter of the ray based on the comparison result to obtain an optimized ray detection parameter; Based on the optimized ray detection parameters, multiple rays are generated for different parts of the hand model, and corresponding detection attributes are assigned to each ray according to preset object material information, so as to obtain a multi-ray detection model with detection attributes; The multi-ray detection model with detection attributes is used to perform multi-attribute collision detection calculations on objects in a virtual environment to obtain collision detection result data including collision position, collision object material and collision intensity.
[0011] A second aspect of the present invention provides a game anti-mold penetration device, the game anti-mold penetration device comprising: A position calculation module, used to calculate the moving direction vector of the hand model according to the current frame position data and the previous frame position data of the hand model in the virtual environment; A prediction module, configured to predict the next frame position data of the hand model according to the moving direction vector and the current frame position data, and to emit rays based on the next frame position data and the moving direction vector; The judging module is used to judge whether a collision event occurs with the ray in the virtual environment, and to adjust the position of the hand model and render the model when a collision event occurs with the ray.
[0012] The third aspect of the present invention provides a game anti-mold penetration device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected through lines; the at least one processor calls the instructions in the memory so that the game anti-mold penetration device executes the steps of the above-mentioned game anti-mold penetration method.
[0013] A fourth aspect of the present invention provides a computer-readable storage medium, in which instructions are stored, and when the computer-readable storage medium is run on a computer, the computer executes the steps of the above-mentioned game anti-piercing method.
[0014] The above-mentioned game anti-penetration method, device, equipment and storage medium calculate the moving direction vector of the hand model according to the current frame position data and the previous frame position data of the hand model in the virtual environment; predict the next frame position data of the hand model according to the moving direction vector and the current frame position data, and emit rays based on the next frame position data and the moving direction vector; determine whether a collision event occurs in the virtual environment, and adjust the position of the hand model and render the model when a collision event occurs. This method reduces the computational complexity and improves the real-time performance through vector calculation and ray detection. The introduction of model prediction enables the system to respond to potential penetration situations in advance, further improving the efficiency of anti-penetration. The collision processing adopts a direct position adjustment strategy to avoid complex physical simulation calculations, thereby solving the problems of high computational complexity and insufficient real-time performance in the prior art.
[0015] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0016] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 This is a schematic diagram of a first embodiment of a method for preventing game penetration in an embodiment of the present invention; Figure 2 A schematic diagram of an embodiment of a game anti-mold penetration device in an embodiment of the present invention; Figure 3 It is a schematic diagram of an embodiment of a game anti-mold penetration device in an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] The terms "including" and "having" and any variations thereof mentioned in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device end including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or device ends.
[0020] To facilitate understanding of this embodiment, a method for preventing game penetration disclosed in an embodiment of the present invention is first introduced in detail. Figure 1 As shown, the method comprises the following steps: 101. Calculate the moving direction vector of the hand model according to the current frame position data and the previous frame position data of the hand model in the virtual environment; In one embodiment of the present invention, the method of calculating the moving direction vector of the hand model based on the current frame position data and the previous frame position data of the hand model in the virtual environment includes: performing vector subtraction operation on the current frame position data and the previous frame position data to obtain the moving vector of the hand model; normalizing the moving vector to obtain a unit direction vector; and calculating the average movement amplitude per frame based on the unit direction vector to obtain the moving direction vector of the hand model.
[0021] Specifically, the implementation process of performing vector subtraction operation on the current frame position data and the previous frame position data to obtain the movement vector of the hand model depends on reading and storing two sets of coordinate information, and taking the previous frame position coordinates as the minuend and the current frame position coordinates as the subtrahend in the memory, and then performing difference calculation by coordinate component by coordinate component to generate a three-dimensional vector. Each component contained in the three-dimensional vector represents the position change of the hand model in the three axes of X, Y, and Z, and the positive and negative values can reflect the displacement direction. In order to accurately complete this step, it is necessary to record the time interval between the sampling of the two frames of data to ensure that the corresponding position information is processed in the same time series. In the specific implementation, the position information of at least two frames will be retained in the data structure for subtraction operation, and the corresponding relationship between the previous frame and the current frame will not be disturbed by a fixed frame rate or timestamp association method. After the vector operation step is completed, the system will save the calculated movement vector to the variable or data container used for subsequent processing, and associate it with the timestamp or frame number. The motion vector obtained in this way is the basic data for analyzing the hand movement rules. It directly presents the difference in the actual motion trajectory of the hand from the previous frame to the current frame. A large value means a large displacement amplitude, and a value close to zero means that the movement amplitude of the hand model is very limited.
[0022] Specifically, the implementation process of unitizing the movement vector to obtain the unit direction vector requires first calculating the length of the movement vector. The length is usually obtained by the vector norm formula, that is, the square root of the sum of the squares of each component is obtained to obtain a non-negative real number, which represents the total distance of the movement vector in three-dimensional space. After calculating the length, each component of the movement vector needs to be divided by the length value to form a normalized result, that is, the unit direction vector. This processing enables the subsequent process to exclude the interference of the amplitude when analyzing the direction of hand movement, and only retains pure directional information. In implementation, if the length is zero or very close to zero, the system will handle this extreme case to prevent zero division errors or numerical anomalies. A threshold is usually set to determine whether it is necessary to skip the normalization operation or set the vector to a zero vector. Under normal circumstances, after the unitization is completed, the new vector is only fixed to 1 in size, and its direction is consistent with the original movement vector. When stored in the data structure, its corresponding real length information can be retained, which is convenient for separating the concepts of direction and distance in subsequent calculations. After the unitization process is completed, the unit direction vector and its corresponding frame information and sampling time will be packaged and saved for subsequent processing of the hand motion amplitude.
[0023] Specifically, the process of calculating the average movement amplitude per frame according to the unit direction vector to obtain the movement direction vector of the hand model requires the introduction of an amplitude factor based on the unit direction vector to represent the actual movement amount of the hand model from the previous frame to the current frame. After the unitization is completed, the direction vector itself no longer contains the original amplitude. In order to regain the amplitude part, it is necessary to analyze it based on the length of the coordinate difference between the previous frame and the current frame recorded on file, or in combination with the change trend of the hand movement in multiple frames of data. If the distance between the current frame and the previous frame is used as a direct reference, this distance will be taken and combined with the known frame rate or time interval to generate an average value of the movement amount per frame, and then the value is multiplied by the unit direction vector obtained previously to obtain a new three-dimensional vector. This three-dimensional vector numerically reflects the direction and the actual displacement amplitude, and is also compatible with various interpolation or filtering algorithms to enhance stability in high-speed motion or jitter environments. The new three-dimensional vector is called the movement direction vector of the hand model, which can not only logically represent the movement intention, but also provide accurate position information reference for subsequent collision detection or physical interaction in the graphics rendering stage. During the implementation process, the system will store this moving direction vector in a memory area connected to the rendering or physics engine, and manage it together with the unit direction vector and length information in the time series to ensure that it can be obtained at any time in the subsequent steps and further detection or prediction operations can be performed.
[0024] 102. Predicting the next frame position data of the hand model according to the moving direction vector and the current frame position data, and emitting rays based on the next frame position data and the moving direction vector; In one embodiment of the present invention, predicting the next frame position data of the hand model according to the moving direction vector and the current frame position data, and emitting rays based on the next frame position data and the moving direction vector includes: performing vector addition operations according to the moving direction vector, a preset moving speed parameter and the current frame position data to obtain predicted next frame position data; generating center point coordinates of a spherical ray according to the predicted next frame position data, and determining the radius of the spherical ray according to preset hand model size parameters; constructing ray parameters based on the center point coordinates, the spherical ray radius and the moving direction vector, and emitting rays based on the ray parameters.
[0025] Specifically, after obtaining the moving direction vector, the preset moving speed parameter and the current frame position data, the system will multiply the moving direction vector and the speed parameter to adjust the amplitude so that the vector numerically matches the actual movement trend of the hand model between the current frame and the next frame. Subsequently, the system superimposes the adjusted moving direction vector and each coordinate component of the current frame position data item by item based on the vector addition method to generate a new three-dimensional coordinate, which is regarded as the position prediction result of the next frame. This operation will call a high-precision floating point or double-precision floating point operation interface to reduce the cumulative deviation caused by numerical errors, and store the predicted coordinates in a data structure based on the timestamp or frame number recorded by the system, so as to facilitate subsequent collision detection and rendering module reading. This process requires additional judgment of acceleration and other action state factors. If necessary, the system will introduce an acceleration correction term internally to make the prediction result more consistent with the continuous movement of the hand model in three-dimensional space. After the operation is completed, the predicted coordinates will be associated with the current frame information and saved in the memory or buffer for extraction and use in the next stage. This method determines the direction and speed of movement and obtains the estimated position of the hand model at the next moment at a numerical level, allowing the system to maintain a high level of real-time perception and accuracy of hand movement.
[0026] Specifically, after obtaining the position data of the next frame, the system will directly use this set of three-dimensional coordinates as the center point of the spherical ray to make the detection process consistent with the potential position of the hand model in space. The center point will be written into the core data structure of a ray entity and used as the sphere center coordinate to ensure that the collision detection logic can accurately retrieve the relevant range in the graphics or physics module. While generating the center point coordinates, it is also necessary to obtain the preset hand model size parameters from the system parameters or configuration files. This size parameter is usually set according to the scale and joint layout of the hand in the virtual environment, and expresses the minimum detection radius required for the outer bounding volume of the hand in numerical form. The system calls the reading interface related to the size parameter and assigns the value to the radius field of the spherical ray, thereby establishing a detection range that matches the actual size of the hand model. When implementing this process, the necessary unit conversion and data type check will be performed on the read size data to ensure that there will be no scale mismatch or value overflow in the spatial calculation, and extreme values will be filtered or restricted internally. After generating the coordinates of the center point of the spherical ray and determining the radius, the system synchronizes these parameters with the timestamp or frame number to ensure that the center point and radius information used in the same frame time are consistent with the predicted coordinates of the next frame. In this way, the ray detection process can cover a reasonable area around the hand model when it is executed, and promptly detect the collision relationship with objects in the virtual environment, making subsequent collision processing more targeted and accurate.
[0027] Furthermore, the performing of vector addition operation on the moving direction vector, the preset moving speed parameter and the current frame position data to obtain the predicted next frame position data includes: performing vector multiplication operation on the moving direction vector and the preset moving speed parameter to obtain a predicted displacement vector; performing weighted fusion processing on the predicted displacement vector and the current acceleration data of the hand model to obtain a corrected predicted displacement vector; performing vector addition operation on the corrected predicted displacement vector and the current frame position data to obtain preliminary predicted next frame position data; performing position correction processing on the preliminary predicted next frame position data and preset boundary constraints to obtain predicted next frame position data.
[0028] Specifically, after obtaining the center point coordinates and radius of the spherical ray, the moving direction vector will be used as the direction or extension basis of the ray, so as to set the detection range and collision retrieval method in three-dimensional space. The construction process will pack the center point coordinates, radius value and direction vector into a unified data structure at the same time, which is usually parsed by the engine's built-in collision detection interface or custom physics module. The data structure contains a description of the ray starting point, a limit on the detection radius, and a mark of the direction, so that the system can perform intersection operations on the scene geometry based on these parameters when performing collision detection. The system submits the constructed ray entity to the detection queue by accessing the API function of the rendering or physics engine, and triggers the emission operation at a specified time. The behavior of emitting rays will perform a series of spatial calculations internally, including determining whether the spherical ray intersects with the polygonal mesh or other collision bodies in the scene during its movement. This process is usually combined with hardware acceleration or algorithm optimization strategies to improve detection efficiency, and the detection results are fed back to the runtime module for further processing of the hand's anti-penetration logic. When constructing ray parameters, it is necessary to ensure that the numerical accuracy of position and direction meets the engine standards, and to perform safety checks for various special cases. For example, when the radius is too large, meaningless out-of-range detection should be avoided. When the direction vector is zero, it is necessary to consider that the hand is in a stationary state and make corresponding processing. After completing the construction and emitting rays, the system will hand over the collision feedback to the subsequent modules to decide whether to adjust the position or posture of the hand model to ensure that the hand and the scene geometry maintain feasible physical constraints, thereby achieving the purpose of preventing the hand from penetrating the model.
[0029] 103. Determine whether a collision event occurs in the virtual environment, and adjust the position of the hand model and render the model when a collision event occurs.
[0030] In one embodiment of the present invention, the determining whether a collision event occurs with the ray in the virtual environment, and adjusting the position of the hand model and rendering the model when a collision event occurs with the ray include: performing collision detection calculations on the ray and objects in the virtual environment to obtain collision detection result data; determining whether there is a collision point based on the collision detection result data, and if so, extracting the collision point coordinate information; calculating the maximum movable distance based on the collision point coordinate information and the current frame position data, and adjusting the position of the hand model to obtain adjusted position data; repositioning and rendering the hand model based on the adjusted position data to obtain an anti-penetration hand model image.
[0031] Specifically, after reading the data structure of the ray entity, the center point coordinates, ray radius, and moving direction vector are obtained from it, and these parameters are input into the collision detection interface provided by the physics or rendering engine. The engine will perform intersection operations on the polygonal meshes, voxel data, or collision bodies in the scene according to the pre-configured algorithm or hardware acceleration method. This operation will find the intersection of the ray path and the object surface or bounding volume in three-dimensional space. When implementing, it is necessary to generate a set of spatial sampling points in memory according to the spherical range of the ray or use analytical methods to gradually check the distance relationship with the scene geometry information. When any sampling point or spatial step length overlaps with the object surface or has a close value, it will be recorded as a collision sign, and the collision object, collision intensity, and contact position information will be used as output data. After the collision detection is completed, the system will write the result into the collision detection result data table, and bind it with the timestamp or frame number of the current frame to ensure that the corresponding data can be retrieved in the graphics rendering and logic processing stage. Usually, a multi-ray combined with multi-attribute detection method is adopted to arrange multiple auxiliary rays around a hand model to capture collision events at different angles or different material information to avoid missing any small contact points. The combination of spherical rays and multiple auxiliary rays can complete a wide range of collision interaction identification in a short time, thereby forming a relatively complete collision detection result at the data level.
[0032] Specifically, after the collision detection interface finishes the calculation, it will generate a set of data records to indicate which scene objects the ray has intersected with during the movement. The system will read this result data to check whether it contains the collision point coordinates and intersection information. If the intersection mark is retrieved, it means that a substantial object surface or obstacle has been detected within the ray range. When extracting the collision point coordinate information, it is necessary to find the corresponding collision record in the collision detection result data table, read the marked spatial coordinate values and store them in an independent data container, which can be jointly managed with the bone node or joint information of the hand. In this process, the accuracy of the coordinate data will be checked to prevent the rounding error of the floating point number in the intersection algorithm from causing rendering anomalies. If there are multiple collision point coordinates in the collision detection result data, the system will filter the position that has the greatest impact on the hand according to the distance or collision intensity, and can also retain all records if necessary for other collision judgment logic or complex interaction effects. After determining that there is a collision point, the system will perform hand position correction in the subsequent logic branch. In order to maintain the accuracy of the process, the coordinates of the collision point will be associated with the current frame to form a complete motion trajectory record and environmental interaction record.
[0033] Specifically, after detecting the coordinates of the real collision point, the system will compare the coordinates with the coordinates of the hand position in the current frame to determine the safe range within which the hand can continue to move in that direction. The specific method is usually to perform vector operations on the coordinates of the collision point and the current position of the hand in three-dimensional space, calculate the collision direction and the distance between the two points through vector difference, and then combine the boundary, buffer zone or safe distance value of the hand model itself to limit the movable range. If the hand collides slightly with the scene, the hand can be numerically moved back to a place slightly separated from the collision point, and ensure that it does not overlap with the scene. This operation generally involves vector subtraction, scalar multiplication, and additional joint constraints or bone restriction algorithms to prevent the joint deformation from exceeding the limit after adjusting the position. After obtaining the new coordinate data, the system will use vector addition to write it into the final position variable of the bone node or joint controller of the hand model, thereby correcting the overall or local joint posture of the hand. At this time, if interference information in other axes or directions is detected, the hand posture can be further fine-tuned in combination with the distribution of the collision points to keep the hand movement within the feasible range. After the position adjustment is completed, it will be associated with the collision event through a timestamp or frame number, and the frame will be logically marked as corrected to prevent repeated large-scale spatial calculations on the same frame. The new position data will then be submitted to the visual rendering pipeline or the posture refresh stage of the physics engine.
[0034] Specifically, after completing the position or posture correction, the system will input the new coordinate information into the rendering module or the skeleton animation system inside the engine. The rendering module accesses the updated joint angles, skeleton postures, and hand mesh data to perform matrix transformation on the hand model in the view, and then generates a three-dimensional image corresponding to the adjusted coordinates on the screen or display device. This image will be combined with effects such as lighting, textures, or shadows, so that the observer can see that the hand remains separated from the collision object in the virtual environment, thereby avoiding penetration of the scene or overlapping each other. If the rendering engine is equipped with advanced shading technology, the material system in the engine will be used to smooth the boundary between the hand and the object to reduce the stuttering or flickering in the rendering. The hand movement is synchronized with the actual control input by refreshing the frame rate in real time, and the new picture is output to the user or further interacted with other logic components at the end of each rendering cycle. In order to ensure that a smooth image is still obtained under fast movement, the interpolation algorithm or advanced filtering mechanism will be used to transition the hand position to a certain extent to reduce abrupt jumps and maintain the smoothness of the hand during the interaction process. This re-positioning and rendering processing mechanism based on collision detection and position correction allows the hand to maintain a realistic physical feel in the scene, and there is no situation where the hand model directly inserts into or crosses obstacles.
[0035] Furthermore, the maximum movable distance is calculated based on the collision point coordinate information and the current frame position data, and the position of the hand model is adjusted to obtain the adjusted position data, including: performing vector subtraction on the collision point coordinate information and the current frame position data to obtain a collision direction vector; performing vector scalar multiplication on the collision direction vector and a preset safety distance parameter to obtain a maximum movable vector; performing vector addition on the maximum movable vector and the current frame position data to obtain adjusted initial position data; performing position optimization processing on the adjusted initial position data and preset hand model joint constraints to obtain adjusted position data.
[0036] Specifically, the process of performing vector subtraction operation on the collision point coordinate information and the current frame position data to obtain the collision direction vector requires first reading two key coordinate data in the memory structure, one is the three-dimensional coordinate representing the collision position, and the other is the three-dimensional coordinate of the hand model at the current frame time. The coordinate data is generally stored in the system buffer in the form of floating point or double precision floating point, and is accompanied by the corresponding frame number or timestamp to ensure the correct correspondence of the data. After obtaining the two coordinates, the system will perform vector subtraction operation in a component-by-component manner. Specifically, subtraction operations are used in the three dimensions of X, Y, and Z to calculate a new three-dimensional vector. This three-dimensional vector is called the collision direction vector, which numerically represents the spatial difference from the current frame position to the collision point position. If any component of the result after vector subtraction is negative, it means that the collision point is closer to the origin or in the opposite direction than the current hand position on this axis. If a component is positive, it means that the collision point is farther away from the origin or in the same direction on this axis. Through this operation, the relative position relationship between the hand and the collision object can be identified at the numerical level, and a direction basis can be provided for subsequent safety distance calculation and position correction. In order to avoid the serious impact of rounding errors on subsequent calculations, the system uses high-precision data types when processing subtraction operations, and performs a numerical range check on the result after the operation is completed. If the value exceeds the reasonable range, the internal exception handling logic will be executed or clipped. The vector subtraction operation is very direct in principle, but in implementation, it is necessary to ensure that the collision point coordinates and the current frame position data are from the same time or adjacent time series, otherwise there will be a coordinate mismatch problem. Generally, the collision detection module has produced accurate collision point coordinates in the previous stage and stored them in a time-tagged result set together with the current frame's posture data, so the position adjustment module can smoothly read and execute the subtraction operation. After the operation is completed, the collision direction vector will be temporarily stored in a local variable or global data structure, waiting for the next step to combine the vector with the safety distance parameter, and then calculate the maximum movement range that the hand model can retain when interacting with the object.
[0037] Specifically, the implementation process of performing vector scalar multiplication based on the collision direction vector and the preset safety distance parameter to obtain the maximum movable vector logically depends on a safety distance coefficient or a safety radius parameter, which is used to describe the minimum interval that the hand model needs to maintain with the collision object. After obtaining the collision direction vector, the system will first perform a norm operation on its length to obtain a non-negative real number, which represents the straight-line distance from the current position of the hand to the collision point in three-dimensional space. Subsequently, the system will normalize the collision direction vector by dividing each component of the vector by the length value just calculated, so that the normalized result only retains the orientation but does not contain the absolute value of the displacement. Normalization is to ensure that only the amplitude of the orientation vector is enlarged or reduced during subsequent multiplication operations, without changing its direction. After obtaining the normalized orientation vector, the system will read the safety distance value from the configuration file or global parameters, and multiply the safety distance by the normalized vector by scalar multiplication to generate a new three-dimensional vector, which can be regarded as the maximum movable vector. At this time, if the distance between the hand and the collision point is less than the safe distance, the system will compare the multiplication result according to the calculation logic. Once it is found that the current distance is not enough to meet the safety requirements, it may perform additional clipping steps internally to limit the result of the scalar multiplication to a smaller range, thereby ensuring that the hand model does not penetrate the collision object. After the scalar multiplication is completed, the system will write the vector into the corresponding data structure of the maximum movable vector, and record the same timestamp or frame number as the current frame for matching subsequent calculations. This process relies on the identification of the collision direction and the numerical definition of the safe distance, enabling the system to quantify the shortest feasible distance between the hand and the obstacle in three-dimensional space, thereby combining the collision direction and the safe interval to output a vector result for position correction.
[0038] Specifically, the maximum movable vector and the current frame position data are added to obtain the adjusted initial position data. The maximum movable vector obtained in the previous step is regarded as the correction offset, and the position data of the current frame is used as the correction reference. After reading these two key variables in the memory, the system adds them component by component to obtain a new three-dimensional coordinate, writes the coordinate into a temporary data structure and calls it the adjusted initial position. The coordinate is equivalent to moving an offset from the current hand position along the collision direction to ensure a safe distance, with the purpose of making the hand retreat from a possible penetration state or transfer to a spatial position that keeps a safe distance from the collision object. Vector addition needs to perform addition operations on the three coordinate axes of X, Y, and Z respectively to ensure that any rotation or offset can be correctly covered. When implemented, the calculation will be performed in floating point or double-precision floating point format to ensure numerical accuracy, and after the calculation is completed, the result will be compared with the original position to see whether the collision elimination requirement is met. If it is found in the comparison that the new position still overlaps with the scene object, the system will repeat the calculation of the previous safe distance or collision direction according to a specific algorithm strategy until an initial position is obtained that does not produce actual penetration. Numerically, this step can not only drag the hand outward to avoid going deep into the collision body, but also flexibly determine whether to offset in the horizontal, vertical or oblique direction according to the positional relationship between the hand and the collision object. After the system completes the calculation, it will mark the adjusted initial position as a temporary feasible coordinate, and add the corresponding time information or frame number, so that the subsequent posture correction and rendering system can seamlessly connect to the adjustment data. This vector addition method is used to achieve instant correction of the hand model in the scene to avoid the erroneous visual effects of overlapping models or spatial interlacing in the case of rapid movement or contact with multiple objects.
[0039] Furthermore, the position optimization processing is performed according to the adjusted initial position data and the preset hand model joint constraints to obtain the adjusted position data, including: parsing the adjusted initial position data to obtain an initial position coordinate set of each joint of the hand model; constructing an inverse kinematics model according to the initial position coordinate set and the preset hand model skeletal structure data to obtain the hand model joint constraints; iteratively optimizing the initial position coordinate set based on the hand model joint constraints to obtain an optimized position coordinate set that satisfies the joint motion range; and reconstructing the overall posture of the hand model according to the optimized position coordinate set to obtain the adjusted position data.
[0040] Specifically, the system will store a set of adjusted initial position data in the memory or cache area. These data generally include the spatial coordinates of the entire hand and the local coordinates of each finger joint relative to the palm or wrist. The parsing process needs to first read this set of data from the global or local record, and then split it according to the bone hierarchy of the hand model, and extract the relative position or absolute position of the finger and palm respectively. During the parsing process, the coordinate value of each joint node will be checked for data type mismatch or numerical abnormality. Once found, the system will perform compensation or filtering operations to ensure that the parsing result meets the engine's requirements for the hand bone definition. For knuckles with multiple phalanges or multiple joints, the parsing process will restore the spatial coordinates of each joint in turn on the path from the palm to the fingertip by indexing step by step, and combine them into a joint coordinate list or matrix for subsequent inverse kinematics calculations. During implementation, if the coordinate data dimension is inconsistent with the bone definition, or the number of parsed joints does not match the set number of knuckles, the system will correct it through the error handling mechanism to avoid incomplete or incorrect coordinates from affecting subsequent optimization. After the parsing operation is completed, a complete set of initial position coordinates of each joint of the hand model can be formed in the memory or data structure, including the three-dimensional coordinates of the wrist, palm and each knuckle, and ensuring that these coordinates conform to the basic relative relationship that has been adjusted in the current frame.
[0041] Specifically, the system will store a set of adjusted initial position data in the memory or cache area. These data generally include the spatial coordinates of the entire hand and the local coordinates of each finger joint relative to the palm or wrist. The parsing process needs to first read this set of data from the global or local record, and then split it according to the bone hierarchy of the hand model, and extract the relative position or absolute position of the finger and palm respectively. During the parsing process, the coordinate value of each joint node will be checked for data type mismatch or numerical abnormality. Once found, the system will perform compensation or filtering operations to ensure that the parsing result meets the engine's requirements for the hand bone definition. For knuckles with multiple phalanges or multiple joints, the parsing process will restore the spatial coordinates of each joint in turn on the path from the palm to the fingertip by indexing step by step, and combine them into a joint coordinate list or matrix for subsequent inverse kinematics calculations. During implementation, if the coordinate data dimension is inconsistent with the bone definition, or the number of parsed joints does not match the set number of knuckles, the system will correct it through the error handling mechanism to avoid incomplete or incorrect coordinates from affecting subsequent optimization. After the parsing operation is completed, a complete set of initial position coordinates of each joint of the hand model can be formed in the memory or data structure, including the three-dimensional coordinates of the wrist, palm and each knuckle, and ensuring that these coordinates conform to the basic relative relationship that has been adjusted in the current frame.
[0042] Specifically, after the inverse kinematics model is built, the initial position coordinate set will be imported into an iterative solution engine or mathematical calculation module. The calculation module will read the joint constraints of the hand model and gradually correct the spatial coordinates or rotation angles of each joint to keep it within the range of activity allowed by the bone structure. Generally, the coordinate errors of each joint will be counted at the initial stage of the iteration to determine whether there are any finger joints that are out of bounds or non-compliant. Then, by analyzing the difference between the exceeded part and the constraint interval, a correction vector or correction rotation is calculated. In each iteration, the system will combine this correction with the coordinates or posture of the previous round, and then check whether the updated joint posture meets the constraints. If there is still a violation of the bone constraints, the correction will be repeated until the convergence standard is reached. Sometimes additional algorithms, such as Newton's method or Jacobian inverse matrix, are introduced to improve iteration efficiency and ensure a smoother correction path. Iterative optimization numerically strives to balance the coupling relationship between the joints to avoid causing another joint to exceed the range again when correcting the posture of one joint. When the states of all joints meet the requirements of active angle and length, the system will mark the coordinate results at this time as the optimized position coordinate set and save it in the memory or global data table for subsequent posture reconstruction and rendering module calls. After this process, the adjusted initial position can be compatible with the joint rules of the hand physiological or virtual settings, avoiding abnormal joint distortion or posture errors.
[0043] Specifically, after the system completes the iterative optimization of all finger joint coordinates, it will map the optimized position coordinate set back to the skeletal animation or joint control system of the hand model. The mapping process requires writing the three-dimensional coordinates or rotation angles of each joint into the hand bone hierarchy, so that the rendering engine or physics engine can deform the hand mesh accordingly, thereby visually re-presenting an overall hand posture that meets the joint restrictions and does not produce model penetration. When reconstructing the posture, if the system uses skinning or bone binding technology, the updated coordinates will be applied to the skeletal animation matrix, and then the positions of each vertex will be calculated through interpolation or weight calculation to synchronize the mesh deformation of the hand with the bone transformation. If some knuckles in the posture need further fine-tuning, the system will make slight modifications based on the previously saved collision data or physical simulation results to ensure that the hand will not overlap abnormally in the scene. After all operations are completed, the system will associate the new hand coordinates with the frame number of the rendering pipeline to provide reference information corresponding to this posture for graphic display or subsequent physical detection. At this point, the position data and joint activity status of the hand in three-dimensional space have been effectively corrected and will be regarded as the actual presentation coordinates of this frame or the next frame, providing accurate input for the next action or collision detection. Through this step, the hand model can show a reasonable integrated posture in the virtual environment, while avoiding excessive joint errors or bones violating physiological limitations, and finally obtain an overall position data that meets all constraint requirements and is compatible with the scene.
[0044] Furthermore, the collision detection calculation between the ray and the object in the virtual environment to obtain the collision detection result data includes: collecting and analyzing the acceleration data and angular velocity data of the hand model to obtain the hand motion state parameters; performing comparison operations on the preset detection thresholds according to the hand motion state parameters, and dynamically adjusting the ray detection parameters of the ray based on the comparison results to obtain optimized ray detection parameters; based on the optimized ray detection parameters, generating multiple rays for different parts of the hand model, and assigning corresponding detection attributes to each ray according to preset object material information to obtain a multi-ray detection model with detection attributes; using the multi-ray detection model with detection attributes to perform multi-attribute collision detection calculations on objects in the virtual environment to obtain collision detection result data including collision position, collision object material and collision intensity.
[0045] Specifically, the system usually monitors the hand model motion data returned by the controller or tracking device in real time during operation, including the value that can represent the linear acceleration of the hand and the angular velocity value of the rotation rate of the hand in three-dimensional space. In order to obtain the accurate hand motion state, it is necessary to set up a data acquisition module in the underlying driver or middleware so that it can read the acceleration and angular velocity raw data output by the sensor at regular intervals. The read raw data will be stored in batches according to the established time interval or frame rate, and then processed by filtering and denoising algorithms. Common practices include Kalman filtering or mean smoothing to avoid interference signals and random noise causing sudden changes in the value. After processing, a relatively smooth acceleration and angular velocity sequence will be obtained in the memory, and then key information will be extracted through mathematical operations, such as the current speed range or rotation state of the hand. In addition, the data will be combined with the hand bone structure to identify which knuckle or joint has the most obvious movement trend in the joint dimension. The hand motion state parameters obtained after analysis and processing usually include linear velocity, angular velocity vector, motion direction and other auxiliary information. These parameters will be packaged and stored in a structured data container with the current timestamp. In order to ensure numerical accuracy and reduce latency, the system sets up a high-frequency sampling and caching mechanism between the hardware bottom layer and the upper layer logic to share this batch of motion state parameters between graphics rendering, physics engine, and interactive logic. This acquisition and analysis processing link focuses on providing more reliable hand dynamic data for collision detection and anti-penetration algorithms, so that the subsequent detection process can have a complete numerical basis when judging high-speed movement or slight rotation of the hand, and can also maintain accurate capture of hand motion information in multi-person collaboration or complex scenes.
[0046] Specifically, after mastering the hand motion state parameters, the detection threshold, such as the speed threshold or the angular velocity threshold, will be read from the configuration file or system variable. By comparing the current hand motion speed, rotation amplitude, etc. with these thresholds one by one, it can be determined whether the hand is in a low-speed, normal-speed or high-speed state at this moment, and whether a large-angle rotation occurs. If the hand linear velocity is detected to be significantly higher than the established threshold, the system will appropriately enlarge the ray detection range to avoid the situation where the hand at high speed instantly crosses the obstacle but is not detected in time; if the angular velocity is detected to rise sharply in a short period of time, the number of rays or the distribution method in the detection parameters will be adjusted so that the rays can cover more directions and capture complex rotation penetration risks. When the dynamic adjustment process is implemented, the parameters of the ray radius, ray extension length or sampling density will be numerically corrected, and the corrected results will be written back to the engine's ray module configuration and stored corresponding to the time or frame number. This adjustment mechanism enables the collision detection logic to adapt to the current movement state of the hand, rather than constantly using the same detection scale or sampling accuracy. If the detection threshold comparison result shows that the hand is in slow or steady motion, the system will appropriately reduce the ray detection parameters to reduce the occupation of system resources and improve rendering or interaction efficiency. Through this comparison operation and dynamic adjustment, the ray detection parameters can be kept consistent with the hand movement state at any time, so that during collision detection, it can not only ensure that the necessary detection space is covered, but also reduce the pressure on system performance. Finally, a set of optimized ray detection parameters is obtained, which is used to generate a more flexible and accurate ray detection model in subsequent steps.
[0047] Specifically, after mastering the hand motion state parameters, the detection threshold, such as the speed threshold or the angular velocity threshold, will be read from the configuration file or system variable. By comparing the current hand motion speed, rotation amplitude, etc. with these thresholds one by one, it can be determined whether the hand is in a low-speed, normal-speed or high-speed state at this moment, and whether a large-angle rotation occurs. If the hand linear velocity is detected to be significantly higher than the established threshold, the system will appropriately enlarge the ray detection range to avoid the situation where the hand at high speed instantly crosses the obstacle but is not detected in time; if the angular velocity is detected to rise sharply in a short period of time, the number of rays or the distribution method in the detection parameters will be adjusted so that the rays can cover more directions and capture complex rotation penetration risks. When the dynamic adjustment process is implemented, the parameters of the ray radius, ray extension length or sampling density will be numerically corrected, and the corrected results will be written back to the engine's ray module configuration and stored corresponding to the time or frame number. This adjustment mechanism enables the collision detection logic to adapt to the current movement state of the hand, rather than constantly using the same detection scale or sampling accuracy. If the detection threshold comparison result shows that the hand is in slow or steady motion, the system will appropriately reduce the ray detection parameters to reduce the occupation of system resources and improve rendering or interaction efficiency. Through this comparison operation and dynamic adjustment, the ray detection parameters can be kept consistent with the hand movement state at any time, so that during collision detection, it can not only ensure that the necessary detection space is covered, but also reduce the pressure on system performance. Finally, a set of optimized ray detection parameters is obtained, which is used to generate a more flexible and accurate ray detection model in subsequent steps.
[0048] Specifically, after loading the multi-ray detection model, the rendering or physics engine will perform intersection operations on the geometric bodies in the scene based on the starting coordinates, direction, length or radius of each ray. The intersection operation will traverse all objects that may overlap with the ray space to check whether geometric intersection or approximate contact occurs. If an intersection occurs, the collision point coordinates, intersection surface normal vector or distance information of the object will be recorded in a data structure. At the same time, because each ray is assigned a material detection attribute, the system will compare the material information of the colliding object, and then add a material identification to the collision result, so that different types of objects such as metal, wood or glass can be distinguished. For the judgment of the collision intensity, an intensity value can be obtained by calculating the relative motion speed and the collision depth, or it can be corrected by combining the material hardness or elasticity parameters. The engine will combine the collision records obtained by each ray to generate a complete collision detection result data, including multiple collision point locations, the object material corresponding to each point, and the intensity value of each collision. This data will be returned to the logic control module or script system to determine whether the hand model performs anti-penetration position correction or further processes the physical and visual feedback generated by the collision. The advantage of multi-attribute detection is that it can simultaneously obtain whether the hand is in contact with the object, what material it is in contact with, and how strong the collision is in a single collision detection, and based on this, quickly adjust the hand movement or simulated interaction.
[0049] In this embodiment, the moving direction vector of the hand model is calculated according to the current frame position data and the previous frame position data of the hand model in the virtual environment; the next frame position data of the hand model is predicted according to the moving direction vector and the current frame position data, and rays are emitted based on the next frame position data and the moving direction vector; it is determined whether a collision event occurs with the ray in the virtual environment, and the position of the hand model is adjusted and the model is rendered when a collision event occurs with the ray. This method reduces the computational complexity and improves the real-time performance through vector calculation and ray detection. The introduction of model prediction enables the system to respond to potential penetration situations in advance, further improving the efficiency of anti-penetration. The collision processing adopts a direct position adjustment strategy to avoid complex physical simulation calculations, thereby solving the problems of high computational complexity and insufficient real-time performance in the prior art.
[0050] The above describes the game anti-mold penetration method in the embodiment of the present invention. The following describes the game anti-mold penetration device in the embodiment of the present invention. Figure 2 In one embodiment of the present invention, a game anti-mold penetration device includes: A position calculation module 201 is used to calculate the moving direction vector of the hand model according to the current frame position data and the previous frame position data of the hand model in the virtual environment; A prediction module 202, configured to predict the next frame position data of the hand model according to the moving direction vector and the current frame position data, and to emit rays based on the next frame position data and the moving direction vector; The judgment module 203 is used to judge whether a collision event occurs with the ray in the virtual environment, and to adjust the position of the hand model and render the model when a collision event occurs with the ray.
[0051] In an embodiment of the present invention, the game anti-mold penetration device runs the above-mentioned game anti-mold penetration method, and the game anti-mold penetration device calculates the moving direction vector of the hand model according to the current frame position data and the previous frame position data of the hand model in the virtual environment; predicts the next frame position data of the hand model according to the moving direction vector and the current frame position data, and emits rays based on the next frame position data and the moving direction vector; determines whether a collision event occurs in the virtual environment, and adjusts the position of the hand model and renders the model when a collision event occurs. This method reduces the computational complexity and improves the real-time performance through vector calculation and ray detection. The introduction of model prediction enables the system to respond to potential mold penetration situations in advance, further improving the efficiency of anti-mold penetration. The collision processing adopts a direct position adjustment strategy to avoid complex physical simulation calculations, thereby solving the problems of high computational complexity and insufficient real-time performance in the prior art.
[0052] above Figure 2 The game anti-mould penetration device in the embodiment of the present invention is described in detail from the perspective of modular functional entities, and the game anti-mould penetration device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0053] Figure 3 3 is a schematic diagram of the structure of a game anti-mold penetration device provided by an embodiment of the present invention. The game anti-mold penetration device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 310 (for example, one or more processors) and memory 320, one or more storage media 330 (for example, one or more mass storage device terminals) storing application systems 333 or data 332. Among them, the memory 320 and the storage medium 330 can be short-term storage or permanent storage. The system stored in the storage medium 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the game anti-mold penetration device 300. Furthermore, the processor 310 can be configured to communicate with the storage medium 330, and execute a series of instruction operations in the storage medium 330 on the game anti-mold penetration device 300 to implement the steps of the above-mentioned game anti-mold penetration method.
[0054] The game anti-mold device 300 may also include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input and output interfaces 360, and / or one or more operating systems 331, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 3 The structure of the game anti-mold penetration device shown does not constitute a limitation on the game anti-mold penetration device provided by the present invention, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0055] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the game anti-mold penetration method.
[0056] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0057] If 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. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store system code.
[0058] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for preventing game from being played, characterized in that: The game anti-mold penetration method comprises: Calculating a moving direction vector of the hand model according to current frame position data and previous frame position data of the hand model in the virtual environment; Predicting the next frame position data of the hand model according to the moving direction vector and the current frame position data, and emitting rays based on the next frame position data and the moving direction vector; It is determined whether a collision event occurs with the ray in the virtual environment, and when a collision event occurs with the ray, the position of the hand model is adjusted and the model is rendered.
2. The game anti-mold penetration method according to claim 1, characterized in that: The step of calculating the moving direction vector of the hand model according to the current frame position data and the previous frame position data of the hand model in the virtual environment comprises: Performing a vector subtraction operation on the current frame position data and the previous frame position data to obtain a movement vector of the hand model; Performing unitization processing on the movement vector to obtain a unit direction vector; The average movement amplitude per frame is calculated according to the unit direction vector to obtain the movement direction vector of the hand model.
3. The game anti-mold penetration method according to claim 1, characterized in that: The predicting the next frame position data of the hand model according to the moving direction vector and the current frame position data, and emitting rays based on the next frame position data and the moving direction vector comprises: Performing a vector addition operation according to the moving direction vector, a preset moving speed parameter and the current frame position data to obtain predicted next frame position data; Generate the center point coordinates of the spherical ray according to the predicted next frame position data, and determine the radius of the spherical ray according to the preset hand model size parameters; Ray parameters are constructed based on the center point coordinates, the spherical ray radius and the moving direction vector, and rays are emitted based on the ray parameters.
4. The game anti-mold penetration method according to claim 3, characterized in that: The performing a vector addition operation according to the moving direction vector, the preset moving speed parameter and the current frame position data to obtain the predicted next frame position data comprises: Performing vector multiplication operation on the moving direction vector and a preset moving speed parameter to obtain a predicted displacement vector; Performing weighted fusion processing according to the predicted displacement vector and current acceleration data of the hand model to obtain a corrected predicted displacement vector; Performing vector addition operation on the corrected predicted displacement vector and the current frame position data to obtain preliminary predicted next frame position data; Position correction processing is performed according to the initially predicted next frame position data and preset boundary constraints to obtain predicted next frame position data.
5. The game anti-mold penetration method according to claim 1, characterized in that: The determining whether a collision event occurs to the ray in the virtual environment, and adjusting the position of the hand model and rendering the model when a collision event occurs to the ray includes: Performing collision detection calculation on the ray and the object in the virtual environment to obtain collision detection result data; Determine whether there is a collision point according to the collision detection result data, and if so, extract the collision point coordinate information; Calculate the maximum movable distance based on the collision point coordinate information and the current frame position data, and adjust the position of the hand model to obtain adjusted position data; The hand model is repositioned and rendered according to the adjusted position data to obtain an anti-penetration hand model image.
6. The game anti-mold penetration method according to claim 5, characterized in that: The maximum movable distance is calculated based on the collision point coordinate information and the current frame position data, and the position of the hand model is adjusted to obtain the adjusted position data, including: Performing vector subtraction operation on the collision point coordinate information and the current frame position data to obtain a collision direction vector; Performing a vector scalar multiplication operation according to the collision direction vector and a preset safety distance parameter to obtain a maximum movable vector; Performing a vector addition operation on the maximum movable vector and the current frame position data to obtain adjusted initial position data; Position optimization processing is performed according to the adjusted initial position data and preset hand model joint constraints to obtain adjusted position data.
7. The game anti-mold penetration method according to claim 5, characterized in that: The performing collision detection calculation on the ray and the object in the virtual environment to obtain the collision detection result data comprises: Collecting and analyzing the acceleration data and angular velocity data of the hand model to obtain hand motion state parameters; performing a comparison operation on a preset detection threshold according to the hand motion state parameter, and dynamically adjusting the ray detection parameter of the ray based on the comparison result to obtain an optimized ray detection parameter; Based on the optimized ray detection parameters, multiple rays are generated for different parts of the hand model, and corresponding detection attributes are assigned to each ray according to preset object material information, so as to obtain a multi-ray detection model with detection attributes; The multi-ray detection model with detection attributes is used to perform multi-attribute collision detection calculations on objects in a virtual environment to obtain collision detection result data including collision position, collision object material and collision intensity.
8. A game anti-mold penetration device, characterized in that: The game anti-mold penetration device comprises: A position calculation module, used to calculate the moving direction vector of the hand model according to the current frame position data and the previous frame position data of the hand model in the virtual environment; A prediction module, configured to predict the next frame position data of the hand model according to the moving direction vector and the current frame position data, and to emit rays based on the next frame position data and the moving direction vector; The judging module is used to judge whether a collision event occurs with the ray in the virtual environment, and to adjust the position of the hand model and render the model when a collision event occurs with the ray.
9. A game anti-mold penetration device, characterized in that: The game anti-mold penetration device comprises: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the game anti-mold penetration device to perform the steps of the game anti-mold penetration method as described in any one of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the steps of the game anti-mold penetration method as described in any one of claims 1-7 are implemented.
Citation Information
Cited By
Virtual shopping mall shopping navigation system based on VR technology
CN120707237A
Virtual shopping mall navigation system based on VR technology
CN120707237B
Human-computer interaction method and device for virtual light field three-dimensional space
CN120994072A
Human-computer interaction method and device for virtual light field three-dimensional space
CN120994072B
Hand action interaction rendering method and device, storage medium and electronic equipment
CN121482341A