CN110115840A - Object control method for movement, device, terminal and storage medium in virtual scene - Google Patents
Object control method for movement, device, terminal and storage medium in virtual scene Download PDFInfo
- Publication number
- CN110115840A CN110115840A CN201910407630.3A CN201910407630A CN110115840A CN 110115840 A CN110115840 A CN 110115840A CN 201910407630 A CN201910407630 A CN 201910407630A CN 110115840 A CN110115840 A CN 110115840A
- Authority
- CN
- China
- Prior art keywords
- target object
- liquid
- volume
- immersion
- force information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/55—Controlling game characters or game objects based on the game progress
- A63F13/57—Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/80—Special adaptations for executing a specific game genre or game mode
- A63F13/803—Driving vehicles or craft, e.g. cars, airplanes, ships, robots or tanks
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
- A63F2300/60—Methods for processing data by generating or executing the game program
- A63F2300/64—Methods for processing data by generating or executing the game program for computing dynamical parameters of game objects, e.g. motion determination or computation of frictional forces for a virtual car
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F2300/00—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
- A63F2300/80—Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game specially adapted for executing a specific type of game
- A63F2300/8017—Driving on land or water; Flying
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Processing Or Creating Images (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
This application discloses object control method for movement, device, terminal and the storage mediums in a kind of virtual scene, belong to field of computer technology.The described method includes: calculating immersion volume of the target object in liquid object;It obtains and immerses the corresponding geometric center of volume;According to volume geometric center corresponding with volume is immersed is immersed, the effect force information that liquid object generates target object is calculated;According to the driving force information that the power engine of effect force information and target object provides, control target object moves in liquid object.Since the active force that target object is subject in liquid object is calculated according to immersion volume, the integration method based on upstream face piece provided relative to the relevant technologies, the calculating for immersing volume is relatively more simple, therefore it can simplify the object computation complexity that physical motion is simulated in a liquid, reduce calculation amount.
Description
Technical field
The mobile controlling party of object the invention relates to field of computer technology, in particular in a kind of virtual scene
Method, device, terminal and storage medium.
Background technique
Currently, the virtual role of player's control can drive ship in lake, river in the virtual scene that some game provide
It is travelled in the waters such as stream.
In order to which simulation as true to nature as possible propagates movement in water, the active force for needing Ship ' to be subject in water
(such as buoyancy) controls ship and moves in water then in conjunction with the driving force that the power engine of ship applies to ship.In related skill
In art, a kind of integration method based on upstream face piece is provided, derives the effect that ship is subject in water using hydrodynamics
Power.Wherein, upstream face piece refers to that ship immerses dough sheet in water.
The integration method based on upstream face piece that above-mentioned the relevant technologies provide needs to calculate the relatively fast of each upstream face piece
The information such as degree, angular speed calculate excessively complicated.
Summary of the invention
The embodiment of the present application provides object control method for movement, device, terminal and storage in a kind of virtual scene and is situated between
Matter can be used for solving the relevant technologies when carrying out underwater exercise simulation to ship, calculate excessively complicated technical problem.The skill
Art scheme is as follows:
On the one hand, the embodiment of the present application provides the object control method for movement in a kind of virtual scene, the virtual scene
In include target object and liquid object, the target object moves in the liquid object;
The described method includes:
Calculate immersion volume of the target object in the liquid object;
Obtain the corresponding geometric center of the immersion volume;
According to the immersion volume and the corresponding geometric center of the immersion volume, the liquid object is calculated to the mesh
Mark the effect force information that object generates;
According to the driving force information that the power engine of the effect force information and the target object provides, the mesh is controlled
Mark object moves in the liquid object.
On the other hand, the embodiment of the present application provides a kind of picture display process, which comprises
Display includes the first image frame of virtual scene, includes target object and liquid object in the virtual scene,
The target object moves in the liquid object;
It is mentioned according to the power engine of location information of the target object in first image frame, the target object
The effect force information that the driving force information of confession and the liquid object generate the target object, calculates the object
Location information of the body in the second image frame;
According to location information of the target object in second image frame, second image frame is shown.
On the other hand, the embodiment of the present application provides the object mobile controller in a kind of virtual scene, the virtual field
It include target object and liquid object in scape, the target object moves in the liquid object;
Described device includes:
Volume calculation module, for calculating immersion volume of the target object in the liquid object;
Center obtains module, for obtaining the corresponding geometric center of the immersion volume;
Calculation of the force module, for calculating according to the immersion volume and the corresponding geometric center of the immersion volume
The effect force information that the liquid object generates the target object;
Mobile control module, the driving provided for the power engine according to the effect force information and the target object
Force information controls the target object and moves in the liquid object.
On the other hand, the embodiment of the present application provides a kind of picture display device, and described device includes:
First display module, for show include virtual scene the first image frame, include mesh in the virtual scene
Mark object and liquid object, the target object move in the liquid object;
Position computation module, for location information, the mesh according to the target object in first image frame
The driving force information and the liquid object that the power engine of mark object provides believe the active force that the target object generates
Breath, calculates location information of the target object in the second image frame;
Second display module shows institute for the location information according to the target object in second image frame
State the second image frame.
In another aspect, the embodiment of the present application provides a kind of terminal, the terminal includes processor and memory, the storage
Be stored at least one instruction, at least a Duan Chengxu, code set or instruction set in device, at least one instruction, it is described at least
One Duan Chengxu, the code set or instruction set are loaded by the processor and are executed to realize that the object in above-mentioned virtual scene moves
Flowing control method, or realize above-mentioned picture display process.
Another aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored in the storage medium
At least one instruction, at least a Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, institute
Code set or instruction set is stated to be loaded by processor and executed to realize the object control method for movement in above-mentioned virtual scene, or
Realize above-mentioned picture display process.
Another aspect, the embodiment of the present application provide a kind of computer program product, when the computer program product is performed
When, it is used to execute the object control method for movement in above-mentioned virtual scene, or execute above-mentioned picture display process.
Technical solution provided by the embodiments of the present application include at least it is following the utility model has the advantages that
In technical solution provided by the embodiments of the present application, since the active force that target object is subject in liquid object is root
According to immersing what volume was calculated, relative to the integration method based on upstream face piece that the relevant technologies provide, the meter of volume is immersed
Calculation is relatively more simple, therefore can simplify the object computation complexity that physical motion is simulated in a liquid, reduces calculation amount.
Detailed description of the invention
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, the drawings in the following description are only some examples of the present application, for
For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other
Attached drawing.
Fig. 1 is the schematic diagram for the implementation environment that the application one embodiment provides;
Fig. 2 illustrates the schematic diagram of the overall flow of technical scheme;
Fig. 3 is the flow chart of the object control method for movement in the virtual scene that the application one embodiment provides;
Fig. 4 and Fig. 5 illustrates the schematic diagram of the positional relationship between triangular facet and the water surface;
The tetrahedral schematic diagram that Fig. 6 illustrates reference point and triangular facet is formed;
Fig. 7 illustrates the schematic diagram for the prism that triangular facet and the water surface are formed;
Fig. 8 illustrates the schematic illustration that mobile control is carried out to target object;
Fig. 9 is the flow chart for the picture display process that the application one embodiment provides;
Figure 10 illustrates the schematic diagram of a game picture;
Figure 11 is the block diagram of the object mobile controller in the virtual scene that the application one embodiment provides;
Figure 12 is the block diagram of the object mobile controller in the virtual scene that another embodiment of the application provides;
Figure 13 is the block diagram for the picture display device that the application one embodiment provides;
Figure 14 is the structural block diagram for the terminal that the application one embodiment provides.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application embodiment party
Formula is described in further detail.
Before explanation is introduced to the embodiment of the present application, some nouns involved in the application are explained first
Explanation.
1, virtual scene refers to the non-genuine scene of application builds, can be the simulation to real scene.With trip
For application program of playing, the scene of game that game application provides can be a virtual scene, and the virtual scene is for supplying
The game role of player's control carries out game sports.In the virtual scene, the game role of player's control can be moved
With the various movements of execution, such as jump, release technical ability, movement of opening fire.Virtual scene can be 3D scene, such as virtual room
Room, virtual island, virtual map etc..In virtual scene, other than the virtual role comprising user's control, can also include
Some other virtual objects, such as ground, house, trees, mountains and rivers, river virtual objects.
2, liquid object refers to that attribute in virtual scene is the virtual objects of liquid, such as river, lake, sea.
3, target object is the object for referring to move in the liquid object of virtual scene, such as warship, ship, speedboat, vapour
Ship, sailing boat etc..
4, buoyancy, refer to object in fluid (including liquids and gases), difference (resultant force) of each surface by Fluid pressure.When
When target object moves in liquid object, since a part of volume of target object is immersed in liquid object, liquid
Object can generate buoyancy to target object.
5, lift is the active force for instigating object upward.When target object moves in liquid object, due to object
The water pressure that each position of body is subject to is different, therefore can generate a kind of power that target object lifts.It is with target object
For ship, due to the design of hull bottom, on the bow part hydraulic pressure can be bigger, and stern section hydraulic pressure is smaller, thus covert ground handle
The power that fore lifts.
6, resistance refers to the active force for interfering object of which movement.In the embodiment of the present application, resistance includes moving resistance and bat
Hit power.
7, moving resistance refers to the active force of dragging object hydraulically.When target object moves in liquid object, one side liquid
Body object can hinder target object mobile, generate moving resistance, immersion volume of the another aspect target object in liquid object
Change, can also generate moving resistance.
8, power is flopped, refers to that liquid will be discharged from rigid contact liq subject surface to being immersed in liquid object in object,
Entered water resistance by certain.
Referring to FIG. 1, the schematic diagram of the implementation environment provided it illustrates the application one embodiment.The implementation environment can
To include: server 10 and at least one terminal 20.
Terminal 20 can be such as electronics such as mobile phone, tablet computer, PC (Personal Computer, personal computer)
Equipment.Optionally, the client of destination application is installed, the client of the destination application is capable of providing in terminal 20
The above-mentioned virtual scene comprising liquid object and target object, and target object can move in liquid object.Optionally, on
Stating destination application is to include river, lake in game application, such as the scene of game of game application offer
Equal waters, player can control game role driving ship and move in above-mentioned waters.In the embodiment of the present application, game is answered
It is not construed as limiting with the type of program, can be multiplayer online games, such as MMO RPG (Massive Multiplayer
Online Role-Playing Game, Massively Multiplayer Online Role Playing Games), such as online gunslinging class game of more people.
Server 10 is used to provide background service for terminal 20, can be the background server of destination application.Clothes
Business device 10 can be a server, be also possible to the server cluster being made of multiple servers or a cloud computing
Service centre.
It can be communicated by network between terminal 20 and server 10, such as cable network or wireless network.
In the following, explanation is introduced to the overall flow of technical scheme in conjunction with Fig. 2.As shown in Fig. 2, the application
The overall flow of technical solution includes following several stages: (1) data preparation stage, (2) Calculation of the force stage, (3) torque
Calculation stages and (4) physical analogy stage.
In (1) data preparation stage, each immersion triangular facet of target object is determined, immerse triangular facet and refer to target object
Surface on be immersed in triangular facet in liquid object, then according to each immersion triangular facet of target object, calculate object
Immersion volume and the immersion volume corresponding geometric center of the body in liquid object.
Liquid object is calculated to target in conjunction with the data that (1) data preparation stage obtains in (2) Calculation of the force stage
The active force that object generates, including buoyancy, lift and resistance.Wherein, resistance may include moving resistance and slap power.
Corresponding torque is calculated in conjunction with the active force that (2) Calculation of the force stage obtains in (3) Calculating Torque during Rotary stage.
In (4) physical analogy stage, the active force that (2) Calculation of the force stage is obtained and (3) Calculating Torque during Rotary stage
Obtained torque, is applied on target object, carries out the simulation of physical motion.
In technical scheme, since the active force that target object is subject in liquid object is according to immersion volume
It is calculated, relative to the integration method based on upstream face piece that the relevant technologies provide, immerses the calculating of volume relatively more
Simply, therefore the object computation complexity that physical motion is simulated in a liquid can be simplified, reduces calculation amount.
Referring to FIG. 3, the object control method for movement in the virtual scene provided it illustrates the application one embodiment
Flow chart.This method can be applied in the terminal 20 in implementation environment shown in Fig. 1, as this method can be by pacifying in terminal 20
The client executing of the destination application of dress.For ease of description, in following methods embodiment, only with the execution of each step
Main body is that explanation is introduced in terminal.This method may include the following steps (301~304):
Step 301, immersion volume of the target object in liquid object is calculated.
Immerse the volume that volume refers to target object part below the surface of liquid object.It is travelled in waters with ship
For, a part of ship is more than the water surface, and another part is in the water surface hereinafter, immersing volume is that a part below the water surface
Volume.
Calculate immerse volume when, target object can be immersed in liquid object surface segmentation below at several three
Edged surface (can be described as " immerse triangular facet ") then selects a reference point on the surface of liquid object, by the reference point respectively with
Each vertex for immersing triangular facet is connected, several tetrahedrons (namely using reference point as the triangular pyramid on vertex) is obtained, according to each
A tetrahedral volume can calculate immersion volume.
Step 302, it obtains and immerses the corresponding geometric center of volume.
That a part that target object is immersed in liquid object is a polyhedron, immerses the corresponding geometric center of volume
As polyhedral geometric center.Since the quality of polyhedral different location is different, in polyhedral geometry
The heart may be overlapped with polyhedral mass center.
Step 303, it according to volume geometric center corresponding with volume is immersed is immersed, calculates liquid object and target object is produced
Raw effect force information.
In the embodiment of the present application, active force information includes active force and corresponding torque.With the presence of active force torque,
Torque may also be not present in some active forces.Optionally, the active force that liquid object generates target object includes buoyancy, lift
And resistance.
Step 304, the driving force information provided according to the power engine of effect force information and target object, controls object
Body moves in liquid object.
The power engine of target object refers to that application program is simulated and provides the simulation engine of driving force to the target object.With
For ship, the ship in real scene has engine, which is the power engine of ship, can be provided to ship
Driving force, so that ship overcomes resistance to travel in waters.In virtual scene, in order to be simulated to real scene, target
Object equally exists driving engine, for providing driving force and steering moment to the target object.
In the embodiment of the present application, driving force information may include driving force and corresponding torque.Wherein, force information is driven
It may include the power for driving target object to advance, can also include the torque that driving target object turns to.
Optionally, terminal calculates the power and torque applied to target object, so according to effect force information and driving force information
The power and torque are applied on target object afterwards, control target object moves in liquid object.
In conclusion being subject in liquid object in technical solution provided by the embodiments of the present application due to target object
Active force is calculated according to immersion volume, relative to the integration method based on upstream face piece that the relevant technologies provide, leaching
The calculating for entering volume is relatively more simple, therefore can simplify the object computation complexity that physical motion is simulated in a liquid, subtracts
Few calculation amount.
In addition, in the active force that simulated target object is subject in liquid object, other than considering buoyancy, it is also contemplated that
Lift and resistance, so that the simulation to active force is more comprehensively true to nature.
In the following, explanation is introduced to the calculating process for immersing volume and its geometric center.
In the exemplary embodiment, the calculating process for immersing volume may include the following steps:
1, according to the apparent height of liquid object, each immersion triangular facet of target object is obtained;
It immerses triangular facet and refers to the triangular facet being immersed in liquid object on the surface of target object.By the table of target object
Face is divided into multiple triangular facets, is the calculating for the ease of volume.
Any one triangular facet on the surface of target object is only possible in one of following three kinds of states: leaching completely
Enter into liquid object and (enter water completely), be absolutely not immersed in liquid object (i.e. water outlet completely), be partially immersed in liquid
In body object (i.e. a part enters water).By taking the triangular facet that tri- vertex A, B, C are constituted as an example, above-mentioned three kinds of states are divided
Analysis:
(1) triangular facet is totally immersed in liquid object, its main feature is that tri- points of A, B, C are below the surface of liquid object
Highly.If selecting a reference point P, reference point P to connect with tri- points of A, B, C to form four sides on the surface of liquid object
Body, the tetrahedron are totally immersed in liquid object.At this point, the triangular facet that tri- points of A, B, C are constituted belongs to immersion triangular facet.
(2) triangular facet is absolutely not immersed in liquid object, its main feature is that tri- points of A, B, C are above liquid object
Apparent height.At this point, the triangular facet that tri- points of A, B, C are constituted is not belonging to immerse triangular facet.
(3) triangular facet part is immersed in liquid object, its main feature is that some is lower than liquid object in tri- points of A, B, C
Apparent height, some be higher than liquid object apparent height.This is divided into two kinds of situations again: two points are lower than the table of liquid object
Face height (i.e. two are clicked and entered water), a point are lower than the apparent height of liquid object (i.e. one is clicked and entered water).
For the first case, two when clicking and entering water, as shown in figure 4, straight line L represents the water surface, it is assumed that A be located at the water surface with
On, B and C is located at the water surface hereinafter, triangular facet ABC is divided into 3 triangles X, Y and Z, wherein triangle X is located at the water surface or more,
It is not belonging to immerse triangular facet, triangle Y and Z are located at the water surface hereinafter, belonging to immersion triangular facet.
For second situation, one when clicking and entering water, as shown in figure 5, straight line L represents the water surface, it is assumed that A be located at the water surface with
Under, B and C are located at the water surface or more, and triangular facet ABC is divided into 3 triangles X, Y and Z, wherein triangle X be located at the water surface hereinafter,
Belong to immersion triangular facet, triangle Y and Z are located at the water surface or more, are not belonging to immerse triangular facet.
Therefore, available according to the positional relationship of each triangular facet on the surface of target object and liquid subject surface
Each immersion triangular facet of target object.
2, reference point is selected on the surface of liquid object, calculates separately the four of the reference point and each immersion triangular facet formation
The volume of face body;
The point that terminal can choose the surface that any one in target object is located at liquid object is as a reference point.It is optional
Ground, the geometric center of terminal selection target object liquid subject surface subpoint, it is as a reference point.
As shown in fig. 6, reference point P is connected with each vertex of triangular facet ABC respectively, tetrahedron is formed.This is tetrahedral
Volume ViIt can be calculated using following formula:
Wherein, u, v, w respectively indicate from reference point P to A, the vector of tri- points of B, C.When tri- vectors of u, v, w are counterclockwise
When arrangement, reference point P is in the front of triangular facet ABC, ViIt is greater than 0;Conversely, when tri- vector arranged clockwises of u, v, w,
Reverse side of the reference point P in triangular facet ABC, ViIt is less than 0.
3, above-mentioned each tetrahedral volume is added, obtains immersing volume.
That is, immersing volumeWherein, ViIndicate that reference point immerses the four sides that triangular facet is formed with i-th
The volume of body, n indicate the quantity of immersion triangular facet, and n is positive integer, and i is the positive integer less than or equal to n.
Optionally, the calculating process for immersing the corresponding geometric center of volume may include the following steps:
1, above-mentioned each tetrahedral geometric center is obtained respectively;
Still by taking tetrahedron shown in fig. 6 as an example, the tetrahedral geometric center CiIt can be calculated using following formula
It arrives:
2, it using each tetrahedral volume as weight, according to each tetrahedral geometric center, calculates and immerses volume pair
The geometric center answered.
It is calculated using following formula and immerses the corresponding geometric center C of volume:
Wherein, V indicates to immerse volume, ViIndicate that reference point immerses the tetrahedral volume that triangular facet is formed, C with i-thi
Indicate that reference point immerses the tetrahedral geometric center that triangular facet is formed with i-th, n indicates to immerse the quantity of triangular facet, and n is positive
Integer, i are the positive integer less than or equal to n.
It is provided by the above embodiment to calculate the method for immersing volume, it will be assumed that liquid subject surface is a horizontal plane,
And target object and each intersection point of liquid subject surface are located in same level, this simplifies the calculating for immersing volume.But
There is loss of significance in this, because liquid subject surface may be not a horizontal plane under actual conditions, such as to a certain extent
There are waves.If this loss of significance can not be received, it may be considered that be projected out one towards liquid subject surface from triangle is immersed
The not parallel prism in a top and bottom calculates volume.As shown in fig. 7, broken line L represents horizontal plane, the lower planes of prism are not
In parallel.
In the following, explanation is introduced to the calculating process of each active force and torque.
1, the torque of buoyancy and buoyancy
In the exemplary embodiment, according to the density for immersing volume and liquid object, buoyancy is calculated.Optionally, according to Ah
Base Mead principle calculates buoyancy F according to the following equationb:
Fb=ρ gV;
Wherein, ρ indicates the density of liquid object, and g indicates that acceleration of gravity, V indicate to immerse volume.
Buoyancy direction is that straight up, active position is immersing the corresponding geometric center of volume.When target object is in liquid
When static in body object, the gravity being subject to is identical with buoyancy size, contrary.Due to immersing the corresponding geometry of volume
Center is not always identical with the centroid position of target object, so buoyancy torque can be generated.
Optionally, according to buoyancy, the mass center of immersion volume corresponding geometric center and target object, the power of buoyancy is calculated
Square.The torque T of buoyancy is calculated according to following formulab:
Tb=Fb×r;
Wherein, FbIndicate buoyancy, r is a vector, indicates the matter for immersing volume corresponding geometric center and target object
The three-dimensional coordinate difference of the heart.
In actually calculating, discovery can be very unstable using buoyancy calculations torque, especially in the case where there is billow.Cause
The calculation formula of above-mentioned buoyancy torque can be extended to following formula when actually calculating by this:
Tb=max (- mg, Fb)×r;
Wherein, m indicates the quality of target object, and g indicates acceleration of gravity.
Meanwhile in order to more freely debug the feel of buoyancy, we provide buoyancy torque parameter ParamTb, final floating
The calculation formula of force square can be such that
Tb=((max (- mg, Fb)×r)RT×ParamTb)R;
Wherein, R indicate target object spin matrix, spin matrix be it is orthogonal, calculate when, directly use its transposition
Buoyancy torque is calculated instead of inverting.
2, the torque of lift and lift
By taking target object is ship as an example, ship can allow water to form cyclic annular flow field around it when design, this
Flow field may eventually form lift.When ship is mobile, fluid can be divided into two layers: one section by hull and flow close to hull, claim
For upstream (upstream);One section of outer layer in upstream flows, referred to as downstream (downstream) far from hull.Due to the water surface
There is viscosity, downstream can be involved by the water flow of more bottom, and movement is slower.It thus can on the quarter form a gap, upstream
This gap can be then filled, to form circulation.This circulation can form lift on ship bottom plate.
In the embodiment of the present application, lift is reduced to two parts.First part is according to lift formulaIt is calculated, wherein ρ indicates the density of liquid object, and C indicates the table of lift coefficient and target object
Face shape and towards related, S indicates that immersion area of the target object in liquid object, v are indicated from the far place's liquid of target object
The relative velocity of body object.In practical applications, it can be assumed that liquid object is that flow velocity, v are not the speed of target object.
S is proportional to the contact area of target object Yu liquid subject surface, and it is long that immersion of the target object in liquid object can be used
Degree is indicated multiplied by a definite value.Immersion length of the target object in liquid object, refers to target object and liquid Object table
The distance between two contact points of head and the tail in face.Second part to immerse the square directly proportional of length, object can be allowed by doing so
Body obtains rapidly enough lift after movement is got up in liquid object.
Comprehensive first part and second part above, according to the density of liquid object, the phase of target object and liquid object
To the immersion length of speed and target object in liquid object, lift is calculated.Optionally, it calculates and rises according to following formula
Power Fl:
|Fl|=ParamL1×l|v|2+ParamL2×l2;
Wherein, ParamL1It is the first constant item being calculated according to the density and lift coefficient of liquid object, ParamL2
It is the second constant item, v indicates that relative velocity, l indicate to immerse length.ParamL1And ParamL2It can configure.L can calculated
When the immersion volume of target object, by the model space of the coordinate converting into target object of all immersion triangular facets, calculate
It obtains.
Above-mentioned formula defines the size of lift, and the direction of lift is straight up.The same moment of lift.It is optional
Ground calculates the torque of lift according to the mass center of lift and target object.
When target object is ship when calculating lifting force moment, the arm of force is defined as to the Model Space of target object
Between along negative ship side direction unit vector.Assuming that+z is the front of model, then the torque T of available liftlAre as follows:
Tl=ParamTl×(Fl×([0 0 -1]R-massCenter));
Wherein, ParamTlIndicate that lifting force moment coefficient, R indicate that the spin matrix of target object, massCenter indicate mesh
Mark the mass center of object.
3, the torque of moving resistance and moving resistance
The object run in water will receive the moving resistance of water, according to the classical resistance equation in hydrodynamics:The moving resistance that object is subject in a fluid is F, and ρ is the density of fluid, and C is moving resistance coefficient, and S is
Area of reference, the rectangular projection area being commonly defined as in the direction of motion, v is speed.As when calculating lift, it is assumed that water
Flow velocity is the speed that 0, v is equal to ship.The size of S is proportional to the square root for immersing volume.
In addition, the moving resistance of water is also related with the situation of change of volume is immersed, when immersing volume increase, need
More water are discharged;When immersing volume reduction, has water and be received in.Above-mentioned formulaIt is according to mesh
The moving resistance for entering the calculating of regimen condition of mark object at some time point, it is also necessary to immerse body according between two neighboring time point
Long-pending situation of change calculates additional moving resistance, complements each other between the two moving resistances.Optionally, according to leaching
Enter the calculated moving resistance F of situation of change of volume are as follows:
Wherein, v indicates that the relative velocity of target object and liquid object, m indicate the quality of target object, VtotalIndicate mesh
Mark the total volume of object, VincIndicate the incrementss of immersion volume, VdecIndicate the reduction amount of immersion volume, ParamincWith
ParamdecFor predetermined coefficient.When calculating the incrementss and reduction amount that immerse volume, calculated not in accordance with total immersion volume
, but be respectively calculated according to the tetrahedron that reference point is formed with each triangular facet.That is, VincIndicate reference point and each
It is a to immerse in the tetrahedron that triangular facet is formed, the accumulated value for each tetrahedral incrementss that volume increases;VdecIndicate reference point
In the tetrahedron formed with each immersion triangular facet, the accumulated value for each tetrahedral reduction amount that volume reduces.
In conjunction with it is above-mentioned two aspect, according to the density of liquid object, target object in liquid object along moving direction just
The relative velocity of projected area, target object and liquid object, the quality of target object are handed over, and immerses the variation feelings of volume
Condition calculates moving resistance.Optionally, moving resistance F is calculated according to following formulad:
Wherein, ParamdIt is to be calculated according to the density of liquid object, rectangular projection area and moving resistance coefficient
Third constant item, VimmerseIt indicates to immerse volume.
The same moment of moving resistance, the torque of moving resistance are the angular speed relative to target object.Optionally, root
According to the angular speed of moving resistance and target object, the torque of moving resistance is calculated.For example, calculating moving resistance according to following formula
Torque Td:
Wherein, w indicates the angular speed of target object, ParamTdIndicate constant related with target object.
4, power is flopped
There are described above buoyancy, lift and a moving resistance, movement of the target object in liquid object is very
Close to real world.But target object therefore is showing from not slowing down significantly when falling into liquid object in the air
Increase slap power in example property embodiment.
Optionally, tetrahedron volume, object corresponding to the newly-increased triangular facet according to target object in liquid object
Body and the relative velocity of liquid object and the quality of target object calculate slap power.It is clapped for example, being calculated according to following formula
Hit power Fs:
Wherein, ParamsIt is the constant item for adjusting slap power and influencing, VnewIndicate that target object is each in liquid object
The sum of tetrahedron volume corresponding to newly-increased triangular facet, VnewIt is that the tetrahedron according to corresponding to each newly-increased triangular facet is counted respectively
It calculates, only triangular facet can just can be regarded as newly-increased three from being absolutely not immersed in liquid object to being totally immersed in liquid object
Edged surface.Nnew=normalize (∑ (AiBi×AiCi)Vi new);Wherein, i is positive integer, Ai、BiAnd CiRespectively indicate i-th newly
Increase three vertex of triangular facet, Vi newIndicate tetrahedron volume corresponding to i-th of newly-increased triangular facet, normalize () is indicated
Normalization.
When calculating slap power, in addition to needing to calculate tetrahedron volume corresponding to newly-increased triangular facet, it is also necessary to calculate newly
Increase the direction of triangular facet.Using tetrahedron volume corresponding to newly-increased triangular facet as weight, the method for each newly-increased triangular facet of summing
Line obtains the normal vector of newly-increased volumetric surface.When calculating slap power, using only the velocity component of projection zone's normal vector.Because
The surface of liquid object acts on target object surface, when a dough sheet is from aerial fall into liquid object, by
Resistance centainly vertical dough sheet.
In addition, moving resistance and slap power belong to resistance, they can only allow speed and angular speed to reduce, but cannot be anti-
To.Therefore, it is necessary to by draught control in a certain range.Set Fr=Fd+Fs, Tr=Td, it needs to guarantee:
1、Wherein, m indicates the quality of target object, and v indicates the phase of target object and liquid object
To speed, Δ t indicates the interval duration of twice adjacent calculation.This meets each component of vector.It is why each
Component detects respectively, is because of FrDirection and v direction be different.
2、Wherein, w indicates that the angular speed of target object, R indicate the rotation of target object
Torque battle array, I are inertial tensors, are generally a three-dimensional vector, and Δ t indicates the interval duration of twice adjacent calculation.
In technical solution provided by the embodiments of the present application, the effects of calculating lift, moving resistance when power, Thailand is utilized
The thought of expansion is strangled, the active force that target object is subject to is characterized with several simple multinomial additions, simplifies effect
The calculation of power.
Terminal (such as local client) can calculate a target object in liquid object every prefixed time interval
Volume is immersed, then the geometric center corresponding with volume is immersed according to the immersion volume, calculates liquid object and produce to target object
Raw effect force information, the driving force information then provided according to the power engine of effect force information and target object, controls mesh
Mark object moves in liquid object.Above-mentioned prefixed time interval can be preset according to actual needs, such as each picture
Face frame calculates primary, then (namely Δ t) described above is the interval between two neighboring image frame for the prefixed time interval
Duration.
In addition, terminal (such as local client) is also needed the location information synchronizing of target object to other terminals (such as the
Tripartite's client), so that other terminals can also show motion conditions of the target object in liquid object.Optionally, originally
Ground client sends the location information of target object every prefixed time interval to other clients (namely third party's client);
Wherein, other clients are used for the location information according to target object, the speed and angular speed of target object are calculated, according to target
The speed and angular speed of object, control target object move in liquid object.
Local client described above refers to the client that control target object moves in liquid object, third party visitor
Family end refers to the other clients for being located at same virtual scene with local client.
Using target object as ship, each image frame of local client updates the active force that a ship is subject in water
For.Immersion volume of the local client according to ship in current picture frame in water, the active force and phase that Ship ' is subject to
The torque answered calculates the power and torque applied to ship then in conjunction with driving force and corresponding torque that power engine provides.It
Afterwards, the power and torque are applied on ship by local client, and control ship moves in water.Optionally, drawn by bottom physics
It holds up and the power and torque is applied on ship, control ship moves in water, such as the position in conjunction with ship in current picture frame
Confidence breath and the power and torque, location information of the Ship ' in next image frame.
In addition, local client can be by background server to the location information of third party's client synchronization ship.At this
To apply being not construed as limiting synchronizing frequency in embodiment, such as each frame synchronization is primary, can also be primary every multiframe synchronization, with section
Save expense.Third party's client is according to the location information synchronized, the speed and angular speed of Ship ', then according to the speed
Degree and angular speed control ship move in water.For example, calculating ship in third party's client according to the speed and angular speed
Location information in each image frame of display.
As shown in figure 8, it illustrates the schematic illustration for carrying out mobile control to target object.Terminal can wrap
Include following functional module: buoyancy calculations module 81, buoyancy update module 82, power engine module 83 and synchronization module 84.
Mobile control is carried out to target object, has following two ways: (1) being moved according to power and Torque Control target object
It is dynamic;(2) mobile according to speed and angular speed control target object.Above two mode selects a use, if the two is mixed, can lead
Speed and power is caused to interact, angular speed and torque interact, mobile control inaccuracy.If target object is native client
Controlled object is held, then terminal plants mode using above-mentioned (1), namely mobile according to power and Torque Control target object;Such as
Fruit target object is the object that other clients are controlled, then terminal plants mode using above-mentioned (2), namely according to speed and angle
Speed control target object is mobile.
If planting mode using above-mentioned (1), namely mobile according to power and Torque Control target object, then terminal passes through floating
Power computing module 81 calculates the effect force information that is subject in liquid object of target object, including buoyancy described above, lift,
The effects of resistance power and corresponding torque, by the active force information update into buoyancy update module 82, power engine module 83
Driving force and corresponding torque are provided, then terminal calculates and applies to target object according to effect force information and driving force information
Power and torque, then the power and torque are applied on target object, control target object moved in liquid object.
If planting mode using above-mentioned (2), namely mobile according to speed and angular speed control target object, then terminal is logical
Cross buoyancy calculations module 81 and calculate the effect force information that is subject in liquid object of target object, including buoyancy described above,
The effects of lift, resistance power and corresponding torque, by the active force information update into buoyancy update module 82, terminal is according to floating
Effect force information in power update module 82 calculates the speed and angular speed of target object.Synchronization module 84 receives other clients
Hold the location information of target object synchronized, terminal is according to the speed and angular speed of the positional information calculation target object.
Finally, terminal combines the calculated speed of effect force information and angular speed according to buoyancy update module 82, and according to synchronization
The speed and angular speed that the positional information calculation of module 84 goes out, determine the final speed of target object and angular speed, then root
It is moved in liquid object according to the speed and angular speed control target object.
In the exemplary embodiment, buoyancy update module 82 can safeguard two variables, be denoted as the first variable and second and become
Amount.Wherein, the first variable is used for the torque of memory action power for the effects of storing buoyancy, lift, resistance power, the second variable.
Assuming that terminal calculates every a frame and updates direct action force information, then data in above-mentioned first variable and the second variable,
It can be emptied once every a frame.Terminal calculates the speed of target object according to the active force stored in the first variable, according further to
The torque stored in second variable calculates the angular speed of target object.
In the exemplary embodiment, it is updated by speed and angular speed of the following formula to target object:
wnew=wold+((T0×RT)×I-1)R;
Wherein, voldAnd vnewIt respectively indicates and updates preceding and updated speed, F0Indicate target object in liquid object
The active force being subject to, m indicate the quality of target object, and t indicates the time interval updated;wnewAnd woldRespectively indicate update before and
Updated angular speed, T0Indicate the torque for the active force that target object is subject in liquid object, R indicates the rotation of target object
Torque battle array, I are inertial tensors.
Above-mentioned speed and angular speed are three-dimensional vector, and it includes points of three different directions in three-dimensional cartesian coordinate system
Amount, such as upper and lower (being indicated with up), front and back (being indicated with fwd), the component for controlling (indicating with right) three different directions.It is optional
Ground can be used to allow third party's client to have more reasonable performance to the movement of target object according to power and torque meter
Part component in the speed and angular speed of calculating covers in the speed and angular speed gone out according to synchronous positional information calculation
Part component.For example, using the up component according to power and the speed of torque meter calculating, covering basis to be bonded water surface elevation
The up component for the speed that synchronous positional information calculation goes out, and retain the fwd of the speed gone out according to synchronous positional information calculation
Component and right component are constant.In another example using what is calculated according to power and torque meter to be bonded the feeling fluctuated on the water surface
The fwd component and right component of angular speed, covering according to synchronous positional information calculation go out angular speed fwd component and
Right component, and the up component for retaining the angular speed gone out according to synchronous positional information calculation is constant.
In addition, terminal only can calculate buoyancy when target object is close to the surface of liquid object, opened to reduce CPU
Pin.
In conclusion in technical solution provided by the embodiments of the present application, by target object in liquid object by
To each active force calculated, and according to the active force and corresponding torque, to fortune of the target object in liquid object
It is dynamic to carry out physical analogy, make the more life-like nature of its athletic performance.
Referring to FIG. 9, the flow chart of the picture display process provided it illustrates the application one embodiment.This method can
To be applied in the terminal 20 shown in Fig. 1 in implementation environment, as this method can be by the destination application installed in terminal 20
Client executing.For ease of description, in following methods embodiment, only it is situated between using the executing subject of each step as terminal
Continue explanation.This method may include the following steps (901~903):
Step 901, display includes the first image frame of virtual scene.
It include target object and liquid object in virtual scene, target object moves in liquid object.
Step 902, the location information according to target object in the first image frame, target object power engine provide
The effect force information that driving force information and liquid object generate target object calculates target object in the second image frame
Location information.
For example, terminal can calculate target object in the first image frame in liquid according to the method for foregoing embodiments introduction
Immersion volume in body object calculates liquid object then according to immersion volume geometric center corresponding with the immersion volume
The effect force information that target object is generated.Later, terminal combination liquid object generates target object effect force information and
The driving force information that the power engine of target object provides calculates the power and torque for being applied to target object.Later, terminal according to
Location information of the target object in the first image frame, above-mentioned power and torque calculate target object in the second image frame
Location information.
Step 903, the location information according to target object in the second image frame shows the second image frame.
Terminal calculates target object after the location information in the second image frame, can show the second image frame, and
According to the location information in the second image frame displaying target object.
As shown in Figure 10, it by taking the movement in water of ship in scene of game as an example, is wrapped in the game picture frame that terminal is shown
Containing ship 100, the physical motion simulation of ship 100 in water can be carried out using method described above.Player is in manipulation ship
During oceangoing ship 100 travels in water, for different ships, different aquatic environments, different manipulation experience can be experienced.
Such as when the wave is high, it can brave the wind and the waves;When wave is small, drive very steady.Speedboat, sailing boat, airship can be done
The difference showed into driving feel and water.For example, airship hull bottom is relatively flat and water surface contact area is big, drive by ripples shadow
Sound is bigger, and the resistance being subject to when entering water is bigger.In another example speedboat hull bottom be it is streamlined, forward section is lighter and water surface contact surface
Product is small, and drive the feeling for having and significantly being lifted.
In conclusion in technical solution provided by the embodiments of the present application, by target object in liquid object by
Each active force calculated, and according to the active force and corresponding torque, to movement of the target object in liquid object
Physical analogy is carried out, the more life-like nature of its athletic performance is made.
Following is the application Installation practice, can be used for executing the application embodiment of the method.It is real for the application device
Undisclosed details in example is applied, the application embodiment of the method is please referred to.
Figure 11 is please referred to, the object mobile controller in virtual scene provided it illustrates the application one embodiment
Block diagram.The device has the function of the object control method for movement in the above-mentioned virtual scene of realization, and the function can be by hard
Part is realized, corresponding software realization can also be executed by hardware.The device can be terminal, also can be set in the terminal.It should
Device 1100 may include: volume calculation module 1110, center acquisition module 1120, Calculation of the force module 1130 and mobile control
Molding block 1140.
Volume calculation module 1110, for calculating immersion volume of the target object in the liquid object.
Center obtains module 1120, for obtaining the corresponding geometric center of the immersion volume.
Calculation of the force module 1130 is used for according to the immersion volume and the corresponding geometric center of the immersion volume,
Calculate the effect force information that the liquid object generates the target object.
Mobile control module 1140 is provided for the power engine according to the effect force information and the target object
Force information is driven, the target object is controlled and is moved in the liquid object.
In conclusion being subject in liquid object in technical solution provided by the embodiments of the present application due to target object
Active force is calculated according to immersion volume, relative to the integration method based on upstream face piece that the relevant technologies provide, leaching
The calculating for entering volume is relatively more simple, therefore can simplify the object computation complexity that physical motion is simulated in a liquid, subtracts
Few calculation amount.
In some possible designs, the volume calculation module 1110 is used for:
According to the apparent height of the liquid object, each immersion triangular facet of the target object, the immersion are obtained
Triangular facet refers to the triangular facet being immersed in the liquid object on the surface of the target object;
Reference point is selected on the surface of the liquid object, calculates separately the reference point and each immersion triangular facet
The tetrahedral volume formed;
Each tetrahedral volume is added, the immersion volume is obtained.
In some possible designs, the center obtains module 1120, is used for:
Each tetrahedral geometric center is obtained respectively;
Using each tetrahedral volume as weight, according to each tetrahedral geometric center, described in calculating
Immerse the corresponding geometric center of volume.
In some possible designs, the active force information includes the torque of buoyancy and the buoyancy.Correspondingly, as schemed
Shown in 12, the Calculation of the force module 1130, comprising: buoyancy calculations submodule 1131 is used for:
According to the density for immersing volume and the liquid object, the buoyancy is calculated;
According to the buoyancy, the mass center for immersing volume corresponding geometric center and the target object, described in calculating
The torque of buoyancy.
In some possible designs, the active force information includes the torque of lift and the lift;Correspondingly, as schemed
Shown in 12, the Calculation of the force module 1130, comprising: lift computational submodule 1132 is used for:
According to the density of the liquid object, the relative velocity of the target object and the liquid object and described
Immersion length of the target object in the liquid object, calculates the lift;
According to the mass center of the lift and the target object, the torque of the lift is calculated.
In some possible designs, the active force information includes the torque of moving resistance and the moving resistance;Phase
Ying Di, as shown in figure 12, the Calculation of the force module 1130, comprising: moving resistance computational submodule 1133 is used for:
According to the density of the liquid object, the target object in the liquid object just trading along moving direction
Shadow area, the relative velocity of the target object and the liquid object, the quality of the target object and the immersion body
Long-pending situation of change calculates the moving resistance;
According to the angular speed of the moving resistance and the target object, the torque of the moving resistance is calculated.
In some possible designs, the effect force information further includes slap power;Correspondingly, as shown in figure 12, described
Calculation of the force module 1130, comprising: slap power computational submodule 1134 is used for:
It is described according to the immersion volume and the corresponding geometric center of the immersion volume, calculate the liquid object to institute
State the effect force information of target object generation, comprising:
According to target object tetrahedron volume corresponding to the newly-increased triangular facet in the liquid object, the mesh
Object and the relative velocity of the liquid object and the quality of the target object are marked, the slap power is calculated.
In some possible designs, the mobile control module 1140 is used for:
According to the effect force information and the driving force information, the power and torque applied to the target object is calculated;
The power and torque are applied on the target object, the target object is controlled and is moved in the liquid object
It is dynamic.
In some possible designs, as shown in figure 12, described device 1100 further include:
Position synchronization module 1150, for sending the position of the target object to other clients every prefixed time interval
Confidence breath;
Wherein, other clients are used for the location information according to the target object, calculate the target object
Speed and angular speed control the target object in the liquid object according to the speed and angular speed of the target object
It is mobile.
Figure 13 is please referred to, it illustrates the block diagrams for the picture display device that the application one embodiment provides.Device tool
There is the function of realizing above-mentioned picture display process, the function can also be executed corresponding soft by hardware realization by hardware
Part is realized.The device can be terminal, also can be set in the terminal.The device 1300 may include: the first display module
1310, position computation module 1320 and the second display module 1330.
First display module 1310, for show include virtual scene the first image frame, wrap in the virtual scene
Target object and liquid object are included, the target object moves in the liquid object.
Position computation module 1320, for according to location information of the target object in first image frame, institute
The effect that the driving force information and the liquid object for stating the power engine offer of target object generate the target object
Force information calculates location information of the target object in the second image frame.
Second display module 1330 is shown for the location information according to the target object in second image frame
Show second image frame.
In conclusion in technical solution provided by the embodiments of the present application, by target object in liquid object by
Each active force calculated, and according to the active force and corresponding torque, to movement of the target object in liquid object
Physical analogy is carried out, the more life-like nature of its athletic performance is made.
It should be noted that device provided by the above embodiment, when realizing its function, only with above-mentioned each functional module
It divides and carries out for example, can according to need in practical application and be completed by different functional modules above-mentioned function distribution,
The internal structure of equipment is divided into different functional modules, to complete all or part of the functions described above.In addition,
Apparatus and method embodiment provided by the above embodiment belongs to same design, and specific implementation process is detailed in embodiment of the method, this
In repeat no more.
Figure 14 is please referred to, it illustrates the structural block diagrams for the terminal 1400 that the application one embodiment provides.The terminal
1400 can be the electronic equipments such as mobile phone, tablet computer, game station, PC.
In general, terminal 1400 includes: processor 1401 and memory 1402.
Processor 1401 may include one or more processing cores, such as 4 core processors, 8 core processors etc..Place
Reason device 1401 can use DSP (Digital Signal Processing, Digital Signal Processing), FPGA (Field
Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, may be programmed
Logic array) at least one of example, in hardware realize.Processor 1401 also may include primary processor and coprocessor, master
Processor is the processor for being handled data in the awake state, also referred to as CPU (Central Processing
Unit, central processing unit);Coprocessor is the low power processor for being handled data in the standby state.?
In some embodiments, processor 1401 can be integrated with GPU (Graphics Processing Unit, image processor),
GPU is used to be responsible for the rendering and drafting of content to be shown needed for display screen.In some embodiments, processor 1401 can also be wrapped
AI (Artificial Intelligence, artificial intelligence) processor is included, the AI processor is for handling related machine learning
Calculating operation.
Memory 1402 may include one or more computer readable storage mediums, which can
To be non-transient.Memory 1402 may also include high-speed random access memory and nonvolatile memory, such as one
Or multiple disk storage equipments, flash memory device.In some embodiments, the non-transient computer in memory 1402 can
Storage medium is read for storing at least one instruction, at least one instruction performed by processor 1401 for realizing this Shen
Please in embodiment of the method provide method.
In some embodiments, terminal 1400 is also optional includes: peripheral device interface 1403 and at least one periphery are set
It is standby.It can be connected by bus or signal wire between processor 1401, memory 1402 and peripheral device interface 1403.It is each outer
Peripheral equipment can be connected by bus, signal wire or circuit board with peripheral device interface 1403.Specifically, peripheral equipment includes:
In radio circuit 1404, touch display screen 1405, camera 1406, voicefrequency circuit 1407, positioning component 1408 and power supply 1409
At least one.
It, can be with it will be understood by those skilled in the art that the restriction of the not structure paired terminal 1400 of structure shown in Figure 14
Including than illustrating more or fewer components, perhaps combining certain components or being arranged using different components.
In this example in embodiment, a kind of terminal is additionally provided, the terminal includes processor and memory, the storage
At least one instruction, at least a Duan Chengxu, code set or instruction set are stored in device.At least one instruction, at least one section
Program, code set or instruction set are configured to be executed by one or more than one processor, to realize that above-described embodiment provides
Method.
In the exemplary embodiment, a kind of computer readable storage medium is additionally provided, is stored in the storage medium
At least one instruction, at least a Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, institute
It states code set or described instruction collection and realizes method provided by the above embodiment when being executed by the processor of computer equipment.It is optional
Ground, above-mentioned computer readable storage medium can be ROM, RAM, CD-ROM, tape, floppy disk and optical data storage devices etc..
In the exemplary embodiment, a kind of computer program product is additionally provided, when the computer program product is performed
When, for realizing method provided by the above embodiment.
It should be understood that referenced herein " multiple " refer to two or more."and/or", description association
The incidence relation of object indicates may exist three kinds of relationships, for example, A and/or B, can indicate: individualism A exists simultaneously A
And B, individualism B these three situations.Character "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or".In addition, herein
Described in number of steps, the merely exemplary a kind of possible execution sequencing shown between step, in some other implementations
In example, above-mentioned steps can not also be executed according to number order, and such as the step of two different numbers is performed simultaneously or two
The step of different numbers, executes according to the sequence opposite with diagram, and the embodiment of the present application is not construed as limiting this.
The foregoing is merely the exemplary embodiments of the application, all in spirit herein not to limit the application
Within principle, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.
Claims (14)
1. the object control method for movement in a kind of virtual scene, which is characterized in that include target object in the virtual scene
With liquid object, the target object moves in the liquid object;
The described method includes:
Calculate immersion volume of the target object in the liquid object;
Obtain the corresponding geometric center of the immersion volume;
According to the immersion volume and the corresponding geometric center of the immersion volume, the liquid object is calculated to the object
The effect force information that body generates;
According to the driving force information that the power engine of the effect force information and the target object provides, the object is controlled
Body moves in the liquid object.
2. the method according to claim 1, wherein described calculate the target object in the liquid object
Immersion volume, comprising:
According to the apparent height of the liquid object, each immersion triangular facet of the target object, the immersion triangle are obtained
Face refers to the triangular facet being immersed in the liquid object on the surface of the target object;
Reference point is selected on the surface of the liquid object, the reference point is calculated separately and is formed with each immersion triangular facet
Tetrahedral volume;
Each tetrahedral volume is added, the immersion volume is obtained.
3. according to the method described in claim 2, it is characterized in that, described obtain the corresponding geometric center of the immersion volume,
Include:
Each tetrahedral geometric center is obtained respectively;
Using each tetrahedral volume as weight, according to each tetrahedral geometric center, the immersion is calculated
The corresponding geometric center of volume.
4. the method according to claim 1, wherein the active force information includes the power of buoyancy and the buoyancy
Square;
It is described according to the immersion volume and the corresponding geometric center of the immersion volume, calculate the liquid object to the mesh
Mark the effect force information that object generates, comprising:
According to the density for immersing volume and the liquid object, the buoyancy is calculated;
According to the buoyancy, the mass center for immersing volume corresponding geometric center and the target object, the buoyancy is calculated
Torque.
5. the method according to claim 1, wherein the active force information includes the power of lift and the lift
Square;
It is described according to the immersion volume and the corresponding geometric center of the immersion volume, calculate the liquid object to the mesh
Mark the effect force information that object generates, comprising:
According to the relative velocity of the density of the liquid object, the target object and the liquid object and the target
Immersion length of the object in the liquid object, calculates the lift;
According to the mass center of the lift and the target object, the torque of the lift is calculated.
6. the method according to claim 1, wherein the active force information includes moving resistance and the movement
The torque of resistance;
It is described according to the immersion volume and the corresponding geometric center of the immersion volume, calculate the liquid object to the mesh
Mark the effect force information that object generates, comprising:
According to the density of the liquid object, the target object along the rectangular projection face of moving direction in the liquid object
Long-pending, the described target object and the relative velocity of the liquid object, the quality of the target object and the immersion volume
Situation of change calculates the moving resistance;
According to the angular speed of the moving resistance and the target object, the torque of the moving resistance is calculated.
7. the method according to claim 1, wherein the effect force information further includes slap power;
It is described according to the immersion volume and the corresponding geometric center of the immersion volume, calculate the liquid object to the mesh
Mark the effect force information that object generates, comprising:
According to target object tetrahedron volume corresponding to the newly-increased triangular facet in the liquid object, the object
Body and the relative velocity of the liquid object and the quality of the target object, calculate the slap power.
8. the method according to claim 1, wherein described according to the effect force information and the target object
Power engine provide driving force information, control the target object and moved in the liquid object, comprising:
According to the effect force information and the driving force information, the power and torque applied to the target object is calculated;
The power and torque are applied on the target object, the target object is controlled and is moved in the liquid object.
9. method according to any one of claims 1 to 8, which is characterized in that the method also includes:
The location information of the target object is sent to other clients every prefixed time interval;
Wherein, other clients are used for the location information according to the target object, calculate the speed of the target object
And angular speed controls the target object and moves in the liquid object according to the speed and angular speed of the target object.
10. a kind of picture display process, which is characterized in that the described method includes:
Display includes the first image frame of virtual scene, includes target object and liquid object in the virtual scene, described
Target object moves in the liquid object;
According to the power engine offer of location information, the target object of the target object in first image frame
The effect force information that driving force information and the liquid object generate the target object, calculates the target object and exists
Location information in second image frame;
According to location information of the target object in second image frame, second image frame is shown.
11. the object mobile controller in a kind of virtual scene, which is characterized in that include target object in the virtual scene
With liquid object, the target object moves in the liquid object;
Described device includes:
Volume calculation module, for calculating immersion volume of the target object in the liquid object;
Center obtains module, for obtaining the corresponding geometric center of the immersion volume;
Calculation of the force module, for according to the immersion volume and the corresponding geometric center of the immersion volume, described in calculating
The effect force information that liquid object generates the target object;
Mobile control module, the driving force provided for the power engine according to the effect force information and the target object are believed
Breath, controls the target object and moves in the liquid object.
12. a kind of picture display device, which is characterized in that described device includes:
First display module, for show include virtual scene the first image frame, include object in the virtual scene
Body and liquid object, the target object move in the liquid object;
Position computation module, for location information, the object according to the target object in first image frame
The effect force information that the driving force information and the liquid object that the power engine of body provides generate the target object,
Calculate location information of the target object in the second image frame;
Second display module shows described for the location information according to the target object in second image frame
Two image frames.
13. a kind of terminal, which is characterized in that the terminal includes processor and memory, is stored at least in the memory
One instruction, at least a Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the generation
Code collection or instruction set are loaded by the processor and are executed to realize method as described in any one of claim 1 to 9, Huo Zheshi
Now method as claimed in claim 10.
14. a kind of computer readable storage medium, which is characterized in that be stored at least one instruction, extremely in the storage medium
A few Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code set or instruction
Collection is loaded by processor and is executed to realize method as described in any one of claim 1 to 9, or realizes such as claim 10
The method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910407630.3A CN110115840B (en) | 2019-05-16 | 2019-05-16 | Object movement control method, device, terminal and storage medium in virtual scene |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910407630.3A CN110115840B (en) | 2019-05-16 | 2019-05-16 | Object movement control method, device, terminal and storage medium in virtual scene |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110115840A true CN110115840A (en) | 2019-08-13 |
CN110115840B CN110115840B (en) | 2021-10-29 |
Family
ID=67522632
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910407630.3A Active CN110115840B (en) | 2019-05-16 | 2019-05-16 | Object movement control method, device, terminal and storage medium in virtual scene |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110115840B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110930483A (en) * | 2019-11-20 | 2020-03-27 | 腾讯科技(深圳)有限公司 | Role control method, model training method and related device |
CN111318019A (en) * | 2020-03-02 | 2020-06-23 | 腾讯科技(深圳)有限公司 | Virtual object control method, device, terminal and storage medium |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1121882A (en) * | 1994-08-13 | 1996-05-08 | 陈振诚 | Flying fish type waterborne craft hull |
JP2000342850A (en) * | 1999-06-08 | 2000-12-12 | Konami Co Ltd | Game machine and recording medium |
US20040235543A1 (en) * | 2003-03-31 | 2004-11-25 | Takuro Eika | Game apparatus, game method, and program |
US20060009270A1 (en) * | 2004-07-01 | 2006-01-12 | Takahiko Kobayashi | Game system |
CN1910625A (en) * | 2004-01-13 | 2007-02-07 | 皇家飞利浦电子股份有限公司 | Mesh models with internal discrete elements |
US20090070093A1 (en) * | 2007-09-11 | 2009-03-12 | Namco Bandai Games Inc. | Program, information storage medium, and game device |
US20090099824A1 (en) * | 2005-11-28 | 2009-04-16 | L-3 Communications Corporation | Distributed Physics Based Training System and Methods |
CN101615352A (en) * | 2009-06-19 | 2009-12-30 | 大连海事大学 | Marine simulator KaMeWa type hydraulic jet propulsion hydrofoil motion mathematical model |
EP2450088A2 (en) * | 2010-11-09 | 2012-05-09 | OnLive, Inc. | System and Method for Remote-Hosted Video Effects |
CN108108569A (en) * | 2018-01-04 | 2018-06-01 | 北京航空航天大学 | A kind of hull fast modeling method based on buoyancy face element |
CN108170940A (en) * | 2017-12-26 | 2018-06-15 | 苏州蜗牛数字科技股份有限公司 | A kind of computational methods of the fundamental physical quantity of hull |
CN109325309A (en) * | 2018-10-23 | 2019-02-12 | 哈尔滨工程大学 | The Three-dimensional Numerical Simulation Method of ship large-amplitude roll movement |
KR20190021895A (en) * | 2017-08-24 | 2019-03-06 | 전광학 | Apparatus for rowing game, and system for rowing game, surver for rowing game |
-
2019
- 2019-05-16 CN CN201910407630.3A patent/CN110115840B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1121882A (en) * | 1994-08-13 | 1996-05-08 | 陈振诚 | Flying fish type waterborne craft hull |
JP2000342850A (en) * | 1999-06-08 | 2000-12-12 | Konami Co Ltd | Game machine and recording medium |
US20040235543A1 (en) * | 2003-03-31 | 2004-11-25 | Takuro Eika | Game apparatus, game method, and program |
CN1910625A (en) * | 2004-01-13 | 2007-02-07 | 皇家飞利浦电子股份有限公司 | Mesh models with internal discrete elements |
US20060009270A1 (en) * | 2004-07-01 | 2006-01-12 | Takahiko Kobayashi | Game system |
US20090099824A1 (en) * | 2005-11-28 | 2009-04-16 | L-3 Communications Corporation | Distributed Physics Based Training System and Methods |
US20090070093A1 (en) * | 2007-09-11 | 2009-03-12 | Namco Bandai Games Inc. | Program, information storage medium, and game device |
CN101615352A (en) * | 2009-06-19 | 2009-12-30 | 大连海事大学 | Marine simulator KaMeWa type hydraulic jet propulsion hydrofoil motion mathematical model |
EP2450088A2 (en) * | 2010-11-09 | 2012-05-09 | OnLive, Inc. | System and Method for Remote-Hosted Video Effects |
KR20190021895A (en) * | 2017-08-24 | 2019-03-06 | 전광학 | Apparatus for rowing game, and system for rowing game, surver for rowing game |
CN108170940A (en) * | 2017-12-26 | 2018-06-15 | 苏州蜗牛数字科技股份有限公司 | A kind of computational methods of the fundamental physical quantity of hull |
CN108108569A (en) * | 2018-01-04 | 2018-06-01 | 北京航空航天大学 | A kind of hull fast modeling method based on buoyancy face element |
CN109325309A (en) * | 2018-10-23 | 2019-02-12 | 哈尔滨工程大学 | The Three-dimensional Numerical Simulation Method of ship large-amplitude roll movement |
Non-Patent Citations (3)
Title |
---|
张周康: "多浮体复杂结构物在波浪响应下的数值模拟研究", 《中国优秀硕士学位论文全文数据库》 * |
范福鼎: "虚拟海洋多场景要素实时绘制算法研究", 《中国优秀硕士学位论文全文数据库》 * |
贾翠玲: "船舶运动的虚拟仿真技术研究", 《中国优秀硕士学位论文全文数据库》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110930483A (en) * | 2019-11-20 | 2020-03-27 | 腾讯科技(深圳)有限公司 | Role control method, model training method and related device |
CN110930483B (en) * | 2019-11-20 | 2020-11-24 | 腾讯科技(深圳)有限公司 | Role control method, model training method and related device |
CN111318019A (en) * | 2020-03-02 | 2020-06-23 | 腾讯科技(深圳)有限公司 | Virtual object control method, device, terminal and storage medium |
CN111318019B (en) * | 2020-03-02 | 2021-12-28 | 腾讯科技(深圳)有限公司 | Virtual object control method, device, terminal and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110115840B (en) | 2021-10-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9342918B2 (en) | System and method for using indirect texturing to efficiently simulate and image surface coatings and other effects | |
JP7238143B2 (en) | MOVEMENT CONTROL METHOD AND APPARATUS THEREOF, TERMINAL AND COMPUTER PROGRAM FOR VIRTUAL OBJECT | |
CN103577656B (en) | Submarine launched missile exiting water process three dimension dynamic simulation method | |
US11062513B2 (en) | Liquid simulation method, liquid interaction method and apparatuses | |
CN105913471B (en) | The method and apparatus of picture processing | |
CN108170940B (en) | Method for calculating basic physical quantity of ship body | |
CN110115840A (en) | Object control method for movement, device, terminal and storage medium in virtual scene | |
JP2002298159A (en) | Game information, information storage medium, and game device | |
WO2022127241A1 (en) | Virtual-sphere deformation control method, apparatus, program, and readable medium | |
CN110262526A (en) | A kind of class physical quantity method of underwater robot space 6DOF from boat manipulation forecast | |
KR100950835B1 (en) | Image creating device, image creating method, and computer-readable information recording medium having a program recorded thereon | |
CN115082607A (en) | Virtual character hair rendering method and device, electronic equipment and storage medium | |
CN108108569B (en) | Rapid hull modeling method based on buoyancy surface element | |
CN114037784A (en) | Construction method of ocean scene roaming system | |
US20230351717A1 (en) | Graphic display method and apparatus based on virtual scene, device and medium | |
JP4183104B2 (en) | GAME DEVICE AND INFORMATION STORAGE MEDIUM | |
JP2000172868A (en) | Game device and information storage medium | |
CN116310221A (en) | Ship swaying and visual wave motion matching method, terminal equipment and medium | |
US20240161377A1 (en) | Physics-based simulation of human characters in motion | |
JP3420957B2 (en) | GAME DEVICE AND INFORMATION STORAGE MEDIUM | |
US11830125B2 (en) | Ray-guided water caustics | |
CN115193051A (en) | Virtual vehicle control method and device, electronic equipment and storage medium | |
CN113902784A (en) | Sea wave simulation method and device and electronic equipment | |
JP4575937B2 (en) | Image generating apparatus, image generating method, and program | |
CN117610462B (en) | Sailing boat operation simulation method, sailing boat operation simulation system, sailing boat operation simulation application and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |