Physical state updating method and device, storage medium and electronic device

文档序号:1104657 发布日期:2020-09-29 浏览:19次 中文

阅读说明:本技术 物理状态的更新方法和装置、存储介质、电子装置 (Physical state updating method and device, storage medium and electronic device ) 是由 汪成峰 胡梓楠 于 2020-04-30 设计创作,主要内容包括:本申请公开了一种物理状态的更新方法和装置、存储介质、电子装置。其中,该方法包括:确定虚拟场景中的第一对象,第一对象为虚拟场景中不用进行物理状态模拟处理的对象;对第一对象进行对象状态更新;在对第一对象进行对象状态更新的过程中,调用物理引擎对第二对象和第三对象进行物理状态更新,第二对象和第三对象为虚拟场景中需要进行物理状态模拟处理的对象。本申请解决了相关技术中游戏流程处理效率较低的技术问题。(The application discloses a method and a device for updating a physical state, a storage medium and an electronic device. Wherein, the method comprises the following steps: determining a first object in the virtual scene, wherein the first object is an object which does not need to be subjected to physical state simulation processing in the virtual scene; updating the object state of the first object; and in the process of updating the object state of the first object, calling a physical engine to update the physical state of a second object and a third object, wherein the second object and the third object are objects needing physical state simulation processing in a virtual scene. The method and the device solve the technical problem that the game flow processing efficiency is low in the related technology.)

1. A method for updating a physical state, comprising:

determining a first object in a virtual scene, wherein the first object is an object which does not need physical state simulation processing in the virtual scene;

performing object state update on the first object;

and in the process of updating the object state of the first object, calling a physical engine to update the physical state of a second object and a third object, wherein the second object and the third object are objects needing physical state simulation processing in the virtual scene.

2. The method of claim 1,

performing an object state update on the first object comprises: updating the first object from a first object state to a second object state by running a first thread, wherein the first object state is the object state of the first object at a first time, the second object state is the object state of the first object at a second time, and the first time is earlier than the second time;

the calling the physical engine to perform physical state update on the second object and the third object comprises the following steps: and updating the second object from a first physical state to a second physical state and updating the third object from a third physical state to a fourth physical state by operating a target thread, wherein the target thread is a thread which is operated in parallel with the first thread and belongs to the physical engine, the first physical state is the physical state of the second object at the first time, the second physical state is the physical state of the second object at the second time, the third physical state is the physical state of the third object at the first time, and the fourth physical state is the physical state of the third object at the second time.

3. The method of claim 2, wherein updating the second object from the first physical state to the second physical state and updating the third object from the third physical state to the fourth physical state by running a target thread comprises performing the following steps in the target thread:

updating the second object from the first physical state to the second physical state;

updating the third object from the third physical state to the fourth physical state using the second physical state.

4. The method of claim 2, wherein updating the second object from the first physical state to the second physical state by running the target thread comprises:

and in the case that the number of the second objects is multiple, updating the multiple second objects from the first physical state to the second physical state by running multiple second threads in parallel, wherein the target thread comprises the multiple second threads, each second thread is used for updating the physical state of one second object, and the second objects updated by any two second threads are different.

5. The method of claim 2, wherein updating the third object from the third physical state to the fourth physical state by running a target thread comprises:

and in the case that a plurality of third objects interacting with the same second object exist, updating the third object from the third physical state to the fourth physical state by running a plurality of third threads in parallel, wherein the target thread includes the plurality of third threads, each third thread is used for updating the physical state of one third object, and the third objects updated by any two third threads are different.

6. The method of claim 2, wherein updating the third object from the third physical state to the fourth physical state by running a target thread comprises:

and under the condition that a plurality of third objects interacting with the same second object exist, updating the third object from the third physical state to the fourth physical state by running a second thread and a third thread in parallel, wherein the second thread is used for continuously updating the physical state of the third object after updating the physical state of the second object, each third thread is used for updating the physical state of one third object, and the third objects updated by any two threads in the second thread and the third thread are different.

7. The method of claim 3,

prior to updating the second object from the first physical state to the second physical state, the method further comprises: updating by using the physical engine to obtain a fifth physical state of a fourth object, wherein the fourth object is an object which interacts with the second object in the virtual scene, and the fifth physical state is a physical state of the fourth object at the first time;

updating the second object from the first physical state to the second physical state comprises: updating the second object from the first physical state to the second physical state using the fifth physical state comprises.

8. An apparatus for updating a physical state, comprising:

the device comprises a determining unit, a processing unit and a processing unit, wherein the determining unit is used for determining a first object in a virtual scene, and the first object is an object which does not need physical state simulation processing in the virtual scene;

a first updating unit, configured to perform object state update on the first object;

and the second updating unit is used for calling a physical engine to perform physical state updating on a second object and a third object in the process of performing object state updating on the first object, wherein the second object and the third object are objects which need physical state simulation processing in the virtual scene.

9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 7.

10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any of the preceding claims 1 to 7 by means of the computer program.

21页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:画面的显示方法和装置、存储介质、电子装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类