Method, device and medium for generating air wall in virtual environment

CN115661359BActive Publication Date: 2026-10-09BEIJING XINTANG SICHUANG EDUCATIONAL TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211415182.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-11
Publication Date
2026-10-09
Estimated Expiration
2042-11-11

AI Technical Summary

Technical Problem

目前,在虚拟场景中配置空气墙时需要手动配置多项内容,如:摆放立方体模型,设置立方体模型的位置、角度和缩放系数等参数,配置模型不可见,上述手动配置过程非常复杂漫长,大大影响了空气墙的搭建效率

Benefits of technology

[0019] The technical solution provided in this disclosure has the following advantages compared with the prior art:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115661359B_ABST
    Figure CN115661359B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, device, equipment and medium for generating an air wall in a virtual environment; the method comprises: in response to a click operation of a user, emitting a virtual ray perpendicular to a user interface from a click position of the click operation; detecting an intersection position of the virtual ray and a boundary region in a virtual scene, obtaining a plurality of intersection positions; between each two adjacent intersection positions, configuring model parameters of a preset cubic model according to the intersection positions, generating a collision body; and grouping a plurality of collision bodies with continuous intersection positions to form a closed air wall. The present disclosure can improve the creation efficiency of the air wall.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a method, apparatus, device and medium for generating an air wall in a virtual environment. Background Technology

[0002] In many virtual scenarios such as games and online classrooms, transparent, collision-capable "invisible walls" are often used to block map boundaries and prevent players from entering inaccessible areas. Currently, configuring invisible walls in virtual scenes requires manually configuring multiple aspects, such as placing cube models, setting parameters like position, angle, and scaling, and ensuring the models are invisible. This manual configuration process is very complex and lengthy, significantly impacting the efficiency of building invisible walls. Summary of the Invention

[0003] In order to solve the above-mentioned technical problems, or at least partially solve the above-mentioned technical problems, this disclosure provides a method, apparatus, device and medium for generating air walls in a virtual environment.

[0004] According to one aspect of this disclosure, a method for generating invisible walls in a virtual environment is provided, comprising:

[0005] In response to a user's click action, a virtual ray perpendicular to the user interface is emitted from the click location.

[0006] The intersection points of the virtual ray and the boundary region in the virtual scene are detected to obtain multiple intersection points;

[0007] Between every two adjacent intersection points, the model parameters of the preset cube model are configured according to the intersection point positions to generate a collider.

[0008] The multiple colliding bodies at the intersection point are arranged to form a closed air wall.

[0009] According to another aspect of this disclosure, an apparatus for generating an invisible wall in a virtual environment is provided, comprising:

[0010] A ray emission module is used to emit a virtual ray perpendicular to the user interface from the click position in response to a user's click operation;

[0011] The intersection detection module is used to detect the intersection points of the virtual ray and the boundary region in the virtual scene, and obtain multiple intersection point positions;

[0012] The parameter configuration module is used to configure the model parameters of the preset cube model according to the intersection position between every two adjacent intersection positions to generate a collider.

[0013] A combination module is used to combine multiple colliders at consecutive intersection points into a closed air wall.

[0014] According to another aspect of this disclosure, an electronic device is provided, the electronic device comprising:

[0015] processor;

[0016] Memory used to store the processor's executable instructions;

[0017] The processor is configured to read the executable instructions from the memory and execute the instructions to implement the above-described method for generating air walls in the virtual environment.

[0018] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, which, when executed on a terminal device, cause the terminal device to implement a method for generating an air wall in a virtual environment.

[0019] The technical solution provided in this disclosure has the following advantages compared with the prior art:

[0020] The present disclosure provides a method, apparatus, device, and medium for generating invisible walls in a virtual environment, comprising: responding to a user's click operation, emitting a virtual ray perpendicular to the user interface from the click location; detecting the intersection points of the virtual ray with boundary regions in the virtual scene to obtain multiple intersection points; configuring model parameters of a preset cube model based on the intersection points between every two adjacent intersection points to generate colliders; and forming a closed invisible wall by assembling multiple colliders at consecutive intersection points. This disclosure can improve the efficiency of creating invisible walls. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0022] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart illustrating a method for generating an invisible wall in a virtual environment, as provided in this embodiment of the disclosure.

[0024] Figure 2 A schematic diagram of the intersection location provided for embodiments of this disclosure;

[0025] Figure 3 A schematic diagram of an air wall provided for an embodiment of this disclosure;

[0026] Figure 4 This is a schematic diagram of the collision effect provided in an embodiment of the present disclosure;

[0027] Figure 5 A schematic diagram of the structure of the device for generating air walls in a virtual environment provided in this embodiment of the disclosure;

[0028] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0029] To better understand the above-described objects, features, and advantages of this disclosure, embodiments of the disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of the disclosure are shown in the drawings, it should be understood that the disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0030] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0031] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc., used in this disclosure are only used to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.

[0032] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0033] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0034] Currently, manually configuring invisible walls is very complex and time-consuming, significantly impacting the efficiency of building them. Therefore, this disclosure provides a method, apparatus, device, and medium for generating invisible walls in a virtual environment. For ease of understanding, the embodiments of this disclosure are described below.

[0035] Figure 1 This flowchart illustrates a method for generating an invisible wall in a virtual environment, as provided in this disclosure. This method can be executed by a device for generating an invisible wall in a virtual environment, which can be implemented using software and / or hardware. (Refer to...) Figure 1 The method for generating an air wall in a virtual environment may include the following steps.

[0036] In step S102, in response to the user's click operation, a virtual ray perpendicular to the user interface is emitted from the click position of the click operation.

[0037] Understandably, a viewpoint is required for rendering a virtual scene, from which the user observes the virtual scene. 3D graphics systems typically use a camera to represent the user's viewpoint and define the user's relative position and orientation relative to the virtual scene. The camera's direction, from near to far, forms the near clipping plane and the far clipping plane. The near clipping plane is the user interface, and the near and far clipping planes form a 3D viewport, within which the 3D virtual scene is rendered.

[0038] In this embodiment, in response to a user's click operation, a virtual ray perpendicular to the user interface (i.e., near the clipping plane) can be emitted from the click location in the 3D viewport. The click operation typically refers to a mouse click, touch click, or similar action on the user interface.

[0039] Step S104: Detect the intersection points of the virtual ray and the boundary region in the virtual scene to obtain multiple intersection point positions.

[0040] The virtual ray, emanating from the user interface and traveling to the far clipping plane, intersects with boundary regions in the virtual scene within the 3D viewport. Based on this, multiple intersection points between the virtual ray and the boundary regions in the virtual scene are detected.

[0041] Referring to the above embodiment, multiple intersection points are obtained based on multiple click operations; such as Figure 2 The example shows four intersection points, each of which can be represented by a three-dimensional position vector.

[0042] Step S106: Between every two adjacent intersection points, configure the model parameters of the preset cube model according to the intersection point positions to generate a collision body.

[0043] In this embodiment, the cube model can be understood as a unitary cube with initialized length, width, height, and angle parameters. For ease of configuration, the initial position and angle are typically set to (0,0,0). For any pair of adjacent intersection points, the cube model's length, width, height, placement, and rotation angle can be configured based on these two intersection points to configure the cube model as a collider, which is used to form an air wall.

[0044] In one embodiment, to ensure that the air wall composed of colliders is impassable, a collider component can be added to the cube model. Specifically, the collider component can be configured on the cube model by calling the Unity physics engine, so that the colliders and air walls generated based on the cube model are impassable. After adding the collider component to the cube model, the colliders configured by it and the air walls composed of colliders can block the map boundary, preventing players from walking into areas where their movement is blocked.

[0045] Step S108: Form a closed air wall by combining multiple colliding bodies at the intersection point.

[0046] According to the above embodiments, a collider is generated between every two adjacent intersection points on the map of the virtual scene. Multiple consecutive colliders at the intersection points are combined to obtain a closed air wall.

[0047] The method for generating invisible walls in a virtual environment provided in this embodiment first responds to a user's click operation by emitting a virtual ray perpendicular to the user interface from the click location. It then detects the intersection points of the virtual ray with boundary regions in the virtual scene, obtaining multiple intersection points. Next, between every two adjacent intersection points, the model parameters of a preset cube model are configured according to the intersection points to generate colliders. Finally, multiple consecutive colliders at the intersection points form a closed invisible wall. This technical solution can quickly locate the intersection points of boundary regions in the 3D world using a ray collision detection method. The intersection points allow for automated configuration of the cube model's parameters, resulting in colliders and the enclosed invisible wall. The entire process eliminates the need for users to manually create and adjust the cube model, effectively improving the efficiency of invisible wall creation.

[0048] Regarding step S106, the following is a detailed description of an embodiment in which the model parameters of a preset cube model are configured according to the intersection point position to generate a collider.

[0049] In this embodiment, the model parameters include the placement position of the cube model; correspondingly, configuring the preset placement position of the cube model based on the intersection position can include:

[0050] Configure the center position of two adjacent intersection points as the placement position of the cube model; place the cube model at the placement position.

[0051] Specifically, the placement position Pos of the cube model in three-dimensional space is the position of two adjacent intersection points (p i p i+1 The sum of the three-dimensional position vectors of ) is half, as shown below:

[0052]

[0053] In this three-dimensional coordinate system, the x-axis represents the wall thickness, the y-axis represents the wall height, and the z-axis represents the wall length. In the above formula, p... i (x), p i+1 (x) represents the intersection point p. i p i+1 The position coordinates p in the x-axis direction i (y), p i+1 (y) represents the intersection point p. i p i+1 The position coordinates p in the y-axis direction i (z), p i+1 (z) represents the intersection point p. i p i+1 Position coordinates in the z-axis direction.

[0054] When placing a cube model at the placement position Pos, you can use the cube model's preset anchor point position (such as the center point) as a reference to make the anchor point position coincide with the placement position Pos.

[0055] In this embodiment, the model parameters include the rotation angle of the cube model; correspondingly, configuring the preset rotation angle of the cube model according to the intersection point position can include:

[0056] The orientation of the cube model in the virtual scene is determined based on the three-dimensional position vectors of two adjacent intersection points.

[0057] Specifically, the orientation Dir of the cube model in the 3D virtual scene is the result of subtracting the 3D position vectors of two adjacent intersection points (pi, pi+1):

[0058]

[0059] Based on the quaternion and the placement direction, generate the rotation angle of the cube model; determine the central axis of the cube model in the height direction as the first rotation axis; rotate the cube model from the preset original angle to the rotation angle around the first rotation axis.

[0060] Using quaternions and the cube model's orientation Dir in 3D space, calculate the rotation angle required for the cube model to rotate in 3D space, and rotate the cube model in the height direction according to the rotation angle, while keeping the width and length directions of the cube model unchanged.

[0061] The quaternions described above can represent the rotation of an object around any vector axis, and compared with the methods of Euler angle rotation and rotation matrices, they are more efficient and more flexible in operation. Quaternions are all composed of real numbers plus three imaginary units i, j, and k, and they have the following relationship: i 2 =j 2 =k 2 =-1, i°=j°=k°=1, each quaternion is a linear combination of 1, i, j, and k, that is, a quaternion can generally be represented as a+bi+cj+dk, where a, b, c, and d are real numbers. The geometric meaning of i, j, and k in a quaternion can be understood as a kind of rotation, as follows: i rotation represents the rotation from the positive Z-axis to the positive Y-axis in the plane where the Z-axis intersects the Y-axis; j rotation represents the rotation from the positive X-axis to the positive Z-axis in the plane where the X-axis intersects the Z-axis; k rotation represents the rotation from the positive Y-axis to the positive X-axis in the plane where the Y-axis intersects the X-axis; -i, -j, and -k represent the reverse rotations of i, j, and k, respectively.

[0062] In this embodiment, the model parameters include the wall dimensions of the cube model, which include wall length, wall thickness, and wall height. Accordingly, when configuring the wall dimensions of the preset cube model according to the intersection position, it is necessary to scale the three wall dimensions of wall length, wall thickness, and wall height. This can be referred to as shown below.

[0063] In the length direction, the cube model needs to fill the length gap between two intersection points, and the length gap between any two intersection points is not fixed; based on this, this embodiment can scale the length of the wall so that the scaled wall length matches the length gap between the two intersection points.

[0064] In this embodiment, the original length of the cube model can be obtained; the scaling ratio is determined based on the length between two adjacent intersection points and the original length; wherein the length between two adjacent intersection points is the modulus of the vector of the placement direction Dir. According to the scaling ratio, the cube model is scaled from the original length to the wall length; the scaled wall length is equal to the length between the two intersection points, so that the cube model can completely fill the space between the two intersection points.

[0065] In this embodiment, the wall height can be a preset height value, and the cube model is configured to the preset height value in the height direction. The wall thickness can be a preset thickness value, and the cube model is configured to the preset thickness value in the thickness direction; or, a thickness scaling ratio can be preset, and the initial original wall thickness of the cube model is scaled according to the preset scaling ratio.

[0066] Configure the wall dimensions of the cube model to obtain colliders with wall length, wall thickness, and wall height. In order for them to form a complete air wall, the wall thickness and wall height are equal between different colliders, while the wall length matches the length between the intersection points and can be different for each other.

[0067] It is understood that in the above multiple embodiments of configuring the model parameters of the cube model, there is no limitation on the configuration order of various model parameters such as placement position, wall size (length, thickness and height) and rotation angle, and different configuration orders will not affect the generated collision body after configuration.

[0068] Based on the above embodiments, colliders are continuously created between two adjacent intersection points, thereby creating an invisible wall that the player cannot pass through between multiple consecutive intersection points. The invisible wall can be referenced as follows: Figure 3 Example.

[0069] In a virtual environment, when a player collides with an invisible wall, a collision effect can be displayed at the point of impact to indicate that the area ahead is impassable. Based on this, this embodiment can provide the following method, including:

[0070] (I) In response to the user's click operation, emit a virtual ray perpendicular to the user interface from the click position;

[0071] (II) Detect the intersection points of the virtual ray and the boundary region in the virtual scene to obtain multiple intersection point positions;

[0072] (III) Between every two adjacent intersection points, configure the model parameters of the preset cube model according to the intersection point positions to generate a collider;

[0073] (IV) Form a closed air wall by combining multiple colliding bodies at the intersection point;

[0074] (V) When the target object collides with the invisible wall in the virtual scene, the preset collision effect is displayed at the corresponding collision point on the invisible wall.

[0075] An example of displaying preset collision effects at the corresponding collision points on the air wall can be found below.

[0076] First, the target collider that collides with the target object within the invisible wall is obtained, along with the anchor point position of the target collider and the first direction in which the target collider faces. The target collider is a cube with the target wall's length, thickness, and height. When the target object collides with the invisible wall in the virtual scene, the target collider at the collision point within the invisible wall, the anchor point position of the target collider, and the first direction in which the target collider faces are determined. The anchor point position is also the target collider's placement position Pos; the first direction is also the target collider's placement direction Dir. The target object can be, for example, a player-controlled character, vehicle, or other virtual object that can move on the ground.

[0077] Then, based on the target object's position and anchor point position, a second direction for the target object to move towards the target collider is determined. Specifically, the subtraction of the three-dimensional position vector between the anchor point position of the target collider and the target object's position is used as the reference direction for the target object to move towards the invisible wall (or the target collider). Considering that the target object will not move in the height direction when moving towards the invisible wall, the value of the reference direction in the height direction is set to 0, thus obtaining the second direction for the target object to move towards the target collider.

[0078] An angle is formed between the first direction in which the target collider faces and the second direction in which the target object moves toward the target collider, thereby determining the first included angle between the first and second directions; wherein, the first included angle is an acute angle. Two complementary included angles are formed between the first and second directions, and in this embodiment, the acute angle is taken as the first included angle.

[0079] The second included angle is determined based on the tangent between the thickness and length of the target wall on the bottom surface of the target collider. Specifically, the tangent between the thickness and length of the target wall on the rectangular bottom surface can be calculated first, and then the second included angle can be calculated based on the tangent.

[0080] Next, the pre-configured surface on the target collider is rotated according to the first included angle and the second included angle; the surface is used to bind the collision effect and is completely attached to the air wall.

[0081] In this embodiment, when the first included angle is greater than the second included angle, the central axis of the target collider in the thickness direction of the target wall is determined as the second rotation axis, and the pre-configured surface on the target collider is rotated vertically around the second rotation axis; and the central axis of the target collider in the length direction of the target wall is determined as the third rotation axis, and the surface is rotated vertically around the third rotation axis.

[0082] When the first included angle is not greater than the second included angle, the pre-configured surface on the target collider is rotated vertically around the second rotation axis.

[0083] After rotating the face as described above, the collision effects bound to the face also rotate accordingly. Therefore, the collision effects bound to the rotated face are then displayed. Figure 4 In the example, the collision effect is displayed as a mesh in the form of particle effects.

[0084] In summary, the method for generating invisible walls in a virtual environment provided in this embodiment can automatically configure model parameters such as the placement, rotation angle, and wall dimensions of a cube model using intersection points. This eliminates the need for users to manually create and adjust the cube model, achieving fully automated creation and effectively improving the efficiency of invisible wall creation. When a target object collides with an invisible wall in the virtual scene, a preset collision effect is displayed at the corresponding collision point on the wall. This not only provides timely feedback to the player but also adds to the fun by showcasing the collision effects.

[0085] Figure 5 This is a schematic diagram of a device for generating invisible walls in a virtual environment, provided in an embodiment of this disclosure. This device can be implemented using software and / or hardware to achieve a method for generating invisible walls in a virtual environment. (Refer to...) Figure 5 The device 500 for generating invisible walls in a virtual environment includes:

[0086] The ray emission module 502 is used to emit a virtual ray perpendicular to the user interface from the click position of the user's click operation in response to the user's click operation;

[0087] The intersection detection module 504 is used to detect the intersection points of the virtual ray and the boundary region in the virtual scene, and obtain multiple intersection point positions;

[0088] The parameter configuration module 506 is used to configure the model parameters of the preset cube model according to the intersection position between every two adjacent intersection positions to generate a collider.

[0089] Combination module 508 is used to form a closed air wall by combining multiple collision bodies with consecutive intersection points.

[0090] In one embodiment, the model parameters include the placement position of the cube model, and the parameter configuration module 506 is further configured to:

[0091] The center position of two adjacent intersection points is set as the placement position of the cube model;

[0092] Place the cube model at the designated location.

[0093] The model parameters also include the wall length of the cube model, and the parameter configuration module 506 is further used for:

[0094] Obtain the preset original length of the cube model;

[0095] The scaling ratio is determined based on the length between two adjacent intersection points and the original length;

[0096] According to the scaling ratio, the cube model is scaled from the original length to the wall length.

[0097] In one embodiment, the model parameters include the rotation angle of the cube model, and the parameter configuration module 506 is further configured to:

[0098] The placement orientation of the cube model in the virtual scene is determined based on the three-dimensional position vectors of two adjacent intersection points.

[0099] The rotation angle of the cube model is generated based on the quaternion and the placement direction.

[0100] The central axis of the cube model in the height direction is defined as the first axis of rotation;

[0101] Around the first rotation, the cube model is rotated from the preset original angle to the rotation angle.

[0102] In one embodiment, the apparatus 500 for generating invisible walls in a virtual environment further includes:

[0103] The collision display module is used to display a preset collision effect at the corresponding collision point on the air wall when the target object collides with the air wall in the virtual scene.

[0104] In one embodiment, the collision display module is further used for:

[0105] Obtain the target collider that collides with the target object in the air wall, as well as the anchor point position of the target collider and the first direction in which the target collider is facing; wherein, the target collider is a cube having the target wall length, the target wall thickness and the target wall height;

[0106] Based on the object position of the target object and the anchor point position, determine the second direction in which the target object moves toward the target collider;

[0107] Determine a first included angle between the first direction and the second direction; wherein the first included angle is an acute angle;

[0108] The second included angle is determined based on the tangent between the thickness and length of the target wall on the bottom surface of the target collider.

[0109] The pre-configured surface on the target collider is rotated according to the first included angle and the second included angle; wherein, the surface is used to bind the collision effect;

[0110] The collision effect attached to the rotating back panel is displayed.

[0111] In one embodiment, the collision display module is further used for:

[0112] When the first included angle is greater than the second included angle, the central axis of the target collider in the thickness direction of the target wall is determined as the second rotation axis, and the pre-configured surface on the target collider is rotated vertically around the second rotation axis;

[0113] The central axis of the target collider along the length of the target wall is defined as the third axis of rotation, and the surface is rotated vertically around the third axis of rotation;

[0114] When the first included angle is not greater than the second included angle, the pre-configured surface on the target collider is rotated vertically around the second rotation axis.

[0115] In one embodiment, the apparatus 500 for generating invisible walls in a virtual environment further includes:

[0116] The component configuration module is used to configure the collider component on the cube model by calling the Unity physics engine, so that the collider and the air wall generated based on the cube model cannot be passed through.

[0117] The device provided in this embodiment has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0118] Exemplary embodiments of this disclosure also provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the electronic device to perform a method according to an embodiment of this disclosure.

[0119] Exemplary embodiments of this disclosure also provide a computer program product, including a computer program, wherein, when executed by a processor of a computer, the computer program is used to cause the computer to perform a method according to an embodiment of this disclosure.

[0120] refer to Figure 6The present invention describes a structural block diagram of an electronic device 600 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0121] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. The RAM 603 may also store various programs and data required for the operation of the device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0122] Multiple components in electronic device 600 are connected to I / O interface 605, including: input unit 606, output unit 607, storage unit 608, and communication unit 609. Input unit 606 can be any type of device capable of inputting information to electronic device 600. Input unit 606 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 607 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 608 may include, but is not limited to, disks and optical discs. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0123] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above. For example, in some embodiments, the method for generating invisible walls in a virtual environment can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. In some embodiments, the computing unit 601 can be configured by any other suitable means (e.g., by means of firmware) to perform the method for generating invisible walls in a virtual environment.

[0124] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0125] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0126] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0127] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0128] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0129] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.

[0130] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating invisible walls in a virtual environment, characterized in that, include: In response to a user's click action, a virtual ray perpendicular to the user interface is emitted from the click location. The intersection points of the virtual ray and the boundary region in the virtual scene are detected to obtain multiple intersection points; Between every two adjacent intersection points, the model parameters of the preset cube model are configured according to the intersection point positions to generate a collider. The multiple colliding bodies at the intersection point are arranged to form a closed air wall; The method further includes: When the target object collides with the target collider in the virtual scene, the preset facets on the target collider are rotated according to the first angle and the second angle, and the collision effect bound to the rotated facets is displayed; wherein, the first angle is determined according to the first direction in which the target collider is facing and the second direction in which the target object moves toward the target collider; the second angle is determined according to the tangent between the thickness and length of the target wall on the bottom surface of the target collider.

2. The method according to claim 1, characterized in that, The model parameters include the placement position of the cube model, and configuring the preset model parameters of the cube model according to the intersection position includes: The center position of two adjacent intersection points is set as the placement position of the cube model; Place the cube model at the designated location. The model parameters also include the wall length of the cube model, and configuring the preset model parameters of the cube model according to the intersection position includes: Obtain the preset original length of the cube model; The scaling ratio is determined based on the length between two adjacent intersection points and the original length; According to the scaling ratio, the cube model is scaled from the original length to the wall length.

3. The method according to claim 1 or 2, characterized in that, The model parameters include the rotation angle of the cube model, and the configuration of the preset cube model parameters according to the intersection point position includes: The placement orientation of the cube model in the virtual scene is determined based on the three-dimensional position vectors of two adjacent intersection points. The rotation angle of the cube model is generated based on the quaternion and the placement direction. The central axis of the cube model in the height direction is defined as the first axis of rotation; The cube model is rotated from the preset original angle to the rotation angle around the first rotation axis.

4. The method according to claim 1, characterized in that, The step of rotating a pre-configured surface on the target collider according to a first included angle and a second included angle, and displaying the collision effect bound to the rotated surface, includes: Obtain the target collider that collides with the target object in the air wall, as well as the anchor point position of the target collider and the first direction in which the target collider is facing; wherein, the target collider is a cube having the target wall length, the target wall thickness and the target wall height; Based on the object position of the target object and the anchor point position, determine the second direction in which the target object moves toward the target collider; Determine a first included angle between the first direction and the second direction; wherein the first included angle is an acute angle; The second included angle is determined based on the tangent between the thickness and length of the target wall on the bottom surface of the target collider. The pre-configured surface on the target collider is rotated according to the first included angle and the second included angle; wherein, the surface is used to bind the collision effect; The collision effect attached to the rotating back panel is displayed.

5. The method according to claim 4, characterized in that, The step of rotating the pre-configured surface on the target collider according to the first included angle and the second included angle includes: When the first included angle is greater than the second included angle, the central axis of the target collider in the thickness direction of the target wall is determined as the second rotation axis, and the pre-configured surface on the target collider is rotated vertically around the second rotation axis; Furthermore, the central axis of the target collider along the length of the target wall is defined as the third axis of rotation, and the surface is rotated vertically around the third axis of rotation; When the first included angle is not greater than the second included angle, the pre-configured surface on the target collider is rotated vertically around the second rotation axis.

6. The method according to claim 1, characterized in that, The method further includes: By calling the Unity physics engine to configure the collider component on the cube model, the collider and the air wall generated based on the cube model cannot be passed through.

7. A device for generating an invisible wall in a virtual environment, characterized in that, include: A ray emission module is used to emit a virtual ray perpendicular to the user interface from the click position in response to a user's click operation; The intersection detection module is used to detect the intersection points of the virtual ray and the boundary region in the virtual scene, and obtain multiple intersection point positions; The parameter configuration module is used to configure the model parameters of the preset cube model according to the intersection position between every two adjacent intersection positions to generate a collider. A combination module is used to combine multiple colliders with consecutive intersection points into a closed air wall; The device also includes a collision display module for: When the target object collides with the target collider in the virtual scene, the preset facets on the target collider are rotated according to the first angle and the second angle, and the collision effect bound to the rotated facets is displayed; wherein, the first angle is determined according to the first direction in which the target collider is facing and the second direction in which the target object moves toward the target collider; the second angle is determined according to the tangent between the thickness and length of the target wall on the bottom surface of the target collider.

8. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1-6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, When the computer instructions are executed on a terminal device, the terminal device causes the terminal device to perform the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Method and system for generating blocked areas in game map

    CN112044060A