CN106201510B - A kind of communication means of UE4 particIe system and external data - Google Patents

A kind of communication means of UE4 particIe system and external data Download PDF

Info

Publication number
CN106201510B
CN106201510B CN201610541275.5A CN201610541275A CN106201510B CN 106201510 B CN106201510 B CN 106201510B CN 201610541275 A CN201610541275 A CN 201610541275A CN 106201510 B CN106201510 B CN 106201510B
Authority
CN
China
Prior art keywords
particie system
data
function
module
text
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.)
Active
Application number
CN201610541275.5A
Other languages
Chinese (zh)
Other versions
CN106201510A (en
Inventor
孙农亮
玄令岐
刘清
刘一清
踪琳
滕升华
李超
李晶
曹茂永
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong University of Science and Technology
Original Assignee
Shandong University of Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong University of Science and Technology filed Critical Shandong University of Science and Technology
Priority to CN201610541275.5A priority Critical patent/CN106201510B/en
Publication of CN106201510A publication Critical patent/CN106201510A/en
Application granted granted Critical
Publication of CN106201510B publication Critical patent/CN106201510B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors

Abstract

The invention discloses the communication means of a kind of UE4 particIe system and external data, and the invention belongs to field of virtual reality, including multiple transmitters, each transmitter emits specific particle, and the particle that multiple transmitters emit jointly forms a complete particIe system.The present invention realizes the communication of UE4 and external data, the simulation effect of particIe system can be controlled by external data, the real-life scene of simulation and event that both can be more life-like also greatly improve the real-time of simulation;In academic research, the data that algorithm can also be obtained are transmitted in particIe system, are shown in visual form, are increased learning value.

Description

A kind of communication means of UE4 particIe system and external data
Technical field
The invention belongs to field of virtual reality, and in particular to a kind of communication means of UE4 particIe system and external data.
Background technique
Unreal Engine4 (hereinafter referred to as UE4) is the illusory engine of the newest release of Epic Games company, is one Money is used for the virtual reality software of three-dimensional scenic building, and the crowd including game, animation, virtual reality can be made using the engine More contents equally can be used for many industries such as indoor design, military simulation.In visual editor, exploit person Member directly can freely be put to the object in virtual scene and the control of attribute, and is all real-time rendering.UE4 is same When provide absolutely open source code, exploitation staff development class can be allowed to realize desired result.These all make UE4 can preferably simulate real-life scene and event and interact in real time with the external world.
UE4 provides powerful particIe system simultaneously, preferably can be used to simulate irregular such as cloud, fire, plant Natural scene.ParticIe system dimensional Modeling Technology different from the past, the scene of simulation is resolved into many random distributions by it Fine particle, each particle have one's own attribute and over time constantly variation, so as to dynamic Simulation natural scene variation.The basic thought of particIe system is: need to scene to be simulated resolve into a large amount of point particle, Line particle or face particle simulate the dynamic change of scene by controlling the motion profile of a large amount of particles.Wherein each grain Son has the attribute of oneself, and specific attribute feature is by needing scene to be simulated to determine.The change of particle effect is exactly to pass through to repair Change the parameter realization of particle.
In some particle effects that current UE 4 provides, the most of special effect of simulation that can be very true to nature, these are special What effect effect was related to is transmitted inside UE4 with internal data, this be to the exploitation of UE4 it is inadequate, it is some based on UE4's The simulation of reality scene is also unable to reach real-time vivid effect.And in the research of particIe system, the irregularities such as fire, smog The algorithm of body is research emphasis therein, and during the data for obtaining algorithm are converted into real-time simulation, communication becomes Intermediate portions therein, if lacking the communication with external data, the researching value of the science will have a greatly reduced quality, also can not More true analog natural scene.
Summary of the invention
For the above-mentioned technical problems in the prior art, the invention proposes a kind of UE4 particIe system and external numbers According to communication means, design rationally, overcome the deficiencies in the prior art, have good promotion effect.
To achieve the goals above, the present invention adopts the following technical scheme:
A kind of UE4 particIe system, including multiple transmitters, each transmitter emit specific particle, and multiple transmitters are total Particle with transmitting forms a complete particIe system.
In addition, the present invention is also mentioned that the communication means of a kind of UE4 particIe system and external data, using as described above UE4 particIe system carries out in accordance with the following steps:
Step 1: each transmitter includes different module, changes the dynamic of particle by addition, removing module, passes through a little The data type that module understands module intrinsic parameter is hit, the size by changing parameter observes the change that particIe system simulates effect;
Step 2: the particIe system of original state is created in the editing machine of UE4
Several transmitters are added in particIe system as needed, addition includes Required mould in each transmitter Including block, Spawn module, Lifetime module, InitialSize module, InitialVelocity module, Color module Module;
Step 3: newly-built C++ class simultaneously binds the particIe system created in step 2
Step 3.1: newly-built C++ class
Step 3.1.1: opening UE4 editing machine, creates C++ class, inherits Actor parent;
Step 3.1.2: after newly-built C++ class, UE4 automatically opens Microsoft Visual Studio, and puts up basic Program frame, generate .cpp the and .h file of class;
Step 3.2: binding particIe system
Step 3.2.1: the path of particIe system is found;
Step 3.2.2: it is bound in step 2 in the .cpp file of C++ class by Cast<UParticleSystem>function The particIe system of creation;
Step 4: the interface function of modification particIe system parameter is write in Microsoft Visual Studio
Step 4.1: opening the installation site of UE4, read the source code program of particIe system, find the operation mould of particIe system Formula finds the function in particIe system about parameter;
Step 4.2: writing interface function
Step 4.2.1: pass through MyEffect- > Emitters [i] function and find the transmitter to be modified;
Step 4.2.2: passing through MyEmitter- > LODLevels [i] function and find the module to be modified in transmitter, The parameter to be modified is found under module, and data received in interface function are assigned to the parameter to be modified, different parameters pair Different interface functions is answered, wherein the received data type of interface function wants consistent with the data type of parameter of modification;
Step 5: writing function and read text data
Step 5.1: finding the platform file interface of UE4
The source code of IPlatformFile is found in the source code program of UE4, and finds the interface of IPlatformFile;
Step 5.2: the format for the text file to be read is set in txt file;
Step 5.3: writing text interface function: writing the function for reading text in .cpp file
Step 5.3.1: finding the path of the text file of reading, binds text by FPlatformFileManager function This document;
Step 5.3.2: the data in text file are cached and is converted by LoadFileToString function String format;
Step 5.4: reading text data
Step 5.4.1: each of a line data are read according to space;
Step 5.4.2: the data conversion of reading is assigned at data type required for parameter by grain by Atof function Received parameter in subsystem interface function;
Step 5.4.3: after having read a line, next line to the last a line is and then read;
Step 5.4.4: the final data read in complete text realize the communication of particIe system and external data.
Advantageous effects brought by the present invention:
The invention proposes the communication means of a kind of UE4 particIe system and external data, compared with prior art, the present invention The communication of UE4 and external data is realized, the simulation effect of particIe system can be controlled by external data, it both can be more The real-life scene of simulation true to nature and event, also greatly improve the real-time of simulation;It, can also in academic research It is transmitted in particIe system with the data for obtaining algorithm, is shown in visual form, increase learning value.
Detailed description of the invention
Fig. 1 is the flow diagram of the communication means of a kind of UE4 particIe system of the present invention and external data.
Specific embodiment
With reference to the accompanying drawing and specific embodiment invention is further described in detail:
Embodiment 1:
A kind of UE4 particIe system based on text file, including multiple transmitters, each transmitter emit specific grain Son, the particle that multiple transmitters emit jointly form a complete particIe system.
Embodiment 2:
On the basis of the above embodiments, the present invention is also mentioned that a kind of UE4 particIe system based on text file and external The communication means (as shown in Figure 1) of data carries out in accordance with the following steps:
Step 1: adding or deleting transmitter, the transmitter module of particIe system, changes module parameter, observation simulation effect Fruit.
In the editing interface of UE4 particIe system, add or delete particIe system transmitter and transmitter it is each Module changes parameter, observation simulation effect.ParticIe system is made of multiple transmitters, and each transmitter emits specific particle, Multiple transmitters emit particle jointly and form a complete particIe system.Each transmitter includes different module.It can lead to Cross addition, removing module changes the dynamic of particle.The data type that parameter can be understood after click module in details panel, leads to Cross the change for changing the size observation particIe system simulation effect of parameter.The essential attribute of particle mainly include the following types:
Material: being present in Required module, is the material applied in particle, and material is done more true to nature, particle System is simulated more accurate.
Rate: being present in Spawn module, refers to the production rate of particle, that is, the particle of particIe system transmitting per second Quantity.By the Rate for changing particle, thus it is possible to vary the entire size of particIe system and the closeness of transmitting.
Lifetime: being present in Lifetime module, and the life cycle (in seconds) of single particle, numerical value is bigger, The particle time-to-live is longer.
StartSize: being present in InitialSize module, refers to the initial size of particle, passes through change The numerical value of StartSize can change particle in the size in three directions (x, y, z) respectively.
StartVelocity: being present in InitialVelocity module, refers to the initial velocity of particle, passes through change The numerical value of StartVelocity can change particle in the rate in three directions (x, y, z) respectively.
ColorOverLife: being present in Color module, refers to the variation at any time of the color of particle and changes.
AlphaOverLife: being present in Color module, refers to the variation at any time of the transparency of particle and changes.
Step 2: particIe system is created in editing machine
ParticIe system is created in UE4 editing machine, transmitter is added as needed, adds corresponding mould in the transmitter Block.Target component (parameter that will be changed by interface function) sets initial value, creates the particIe system of an original state.
Step 3: newly-built C++ class simultaneously binds the particIe system created before
1, C++ class is created
UE4 editing machine is opened, C++ class is created, inherits Actor parent.
After creating C++ class, UE4 can automatically open Microsoft Visual Studio (hereinafter referred to as VS), and put up Basic program frame generates .cpp the and .h file of class.
2, particIe system is bound
The path for finding particIe system passes through Cast<UParticleSystem>in the .cpp file of C++ class (StaticLoadObject (UParticleSystem::StaticClass (), NULL, * EffectName.ToS tring ())) function (the function passage path finds the particIe system of creation, wherein EffectName be particIe system path) tie up The particIe system created before fixed.
Step 4: the interface function of particIe system is write
1, the operational mode and parametric function of particIe system are found
Bind particIe system after, open the installation site of UE4, Epic Games 4.9 Engine Source Runtime Engine Classes the source code program of particIe system is found in Particles file, find particIe system About the function of parameter in operational mode and particIe system.
2, interface function is write
The interface function of modification particIe system parameter is write in VS.The interface of the corresponding particIe system of each parameter Function.Wherein interface function can receive data parameters.In interface function, pass through MyEffect- > Emitters [i] function (transmitter in position particles system) finds transmitter Emitters [i] to be modified, pass through in the transmitter MyEmitter- > LODLevels [i] function (module in location transmitters) finds the module Module to be modified, and finding under module will modify Parameter.Data received in interface function are assigned to the parameter to be modified.Different parameters corresponds to different interface functions. Wherein the received data type of interface function wants consistent with the data type of parameter of modification.
Step 5: it writes function and reads text data, realize the communication of external data and particIe system
1, UE4 platform file interface is found
For its portability so C++ java standard library cannot be used directly when carrying out file I/O operation in UE4, UE4 is provided IPlatformFile (platform file I/O interface).Found in the source code program of UE4 the source code of IPlatformFile with And the interface modes of IPlatformFile.
2, data format in text is set
First have to the format that the file of reading is set in txt file.It can be distinguished by space, line feed etc. in UE4 Data.In text file, the data type of data is floating type.The data of every a line indicate the parameter to be modified, for example, often First data of a line are the rates to be modified, and second to fourth data is the every number of the initial size ... to be modified It is separated according between data by space.
3, text interface function is write
The function for reading text is write in .cpp file.The path for finding the text file of reading first, passes through FPlatformFileManager::Get () .GetPlatformFile () .FileExists (* CompleteFilePath)) Function (function of management text, passage path bind text file, and wherein CompleteFilePath is the path of text) is tied up Determine text file.By the data in text file by LoadFileToString function (by the data buffer storage in text at word Accord with the format of string) it caches and is converted into string format.
4, text data is read
Read each of a line data according to space (" "), by data by Atof function (change data format Function) it is converted into data type required for parameter, it is assigned to received parameter in particIe system interface function head.Read one After row, next line to the last a line is read according to line feed T (" n ").It is final to read the data completed in entire text, it realizes The communication of particIe system and external data.
The present invention realizes the communication of UE4 particIe system and external data, can control particle systems by external data The simulation effect of system, the real-life scene of simulation and event that both can be more life-like, also greatly improves simulation Real-time;In academic research, the data that algorithm can also be obtained are transmitted in particIe system, are showed in visual form Out, learning value is increased.
Certainly, the above description is not a limitation of the present invention, and the present invention is also not limited to the example above, this technology neck The variations, modifications, additions or substitutions that the technical staff in domain is made within the essential scope of the present invention also should belong to of the invention Protection scope.

Claims (1)

1. a kind of communication means of UE4 particIe system and external data, it is characterised in that: use a kind of UE4 particIe system, this is System includes multiple transmitters, and each transmitter emits specific particle, and the particle composition one that multiple transmitters emit jointly is complete Whole particIe system;Specifically carry out in accordance with the following steps:
Step 1: the particIe system of original state is created in the editing machine of UE4;
Several transmitters are added in particIe system as needed, in each transmitter addition include Required module, Mould including Spawn module, Lifetime module, InitialSize module, InitialVelocity module, Color module Block;
Step 2: newly-built C++ class simultaneously binds the particIe system created in step 1;
Step 2.1: newly-built C++ class;
Step 2.1.1: opening UE4 editing machine, creates C++ class, inherits Actor parent;
Step 2.1.2: after newly-built C++ class, UE4 automatically opens Microsoft Visual Studio, and puts up basic journey Sequence frame generates .cpp the and .h file of class;
Step 2.2: binding particIe system;
Step 2.2.1: the path of particIe system is found;
Step 2.2.2: it finds in step 1 and creates by Cast<UParticleSystem>function in the .cpp file of C++ class ParticIe system and bound;
Step 3: the interface function of modification particIe system parameter is write in Microsoft Visual Studio;
Step 3.1: passing through MyEffect- > Emitters [i] function and find the transmitter to be modified;
Step 3.2: passing through MyEmitter- > LODLevels [i] function and find the module to be modified in transmitter, under module The parameter to be modified is found, data received in interface function are assigned to the parameter to be modified, different parameters is corresponding different Interface function, wherein the received data type of interface function want with modification the data type of parameter it is consistent;
Step 4: writing function and read text data;
Step 4.1: setting the format for the text file to be read;
Step 4.2: the interface function for reading text is write in .cpp file;
Step 4.2.1: finding the path of the text file of reading, manages text simultaneously by FPlatformFileManager function Bind text file;
Step 4.2.2: the data in text file are cached by LoadFileToString function and are converted into character String format;
Step 4.3: reading text data;
Step 4.3.1: each of a line data are read;
Step 4.3.2: by Atof function by the data conversion of reading at data type required for parameter, and it is assigned to particle Received parameter in system interface function;
Step 4.3.3: after having read a line, next line to the last a line is and then read;
Step 4.3.4: the final data read in complete text realize the communication of particIe system and external data.
CN201610541275.5A 2016-07-11 2016-07-11 A kind of communication means of UE4 particIe system and external data Active CN106201510B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610541275.5A CN106201510B (en) 2016-07-11 2016-07-11 A kind of communication means of UE4 particIe system and external data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610541275.5A CN106201510B (en) 2016-07-11 2016-07-11 A kind of communication means of UE4 particIe system and external data

Publications (2)

Publication Number Publication Date
CN106201510A CN106201510A (en) 2016-12-07
CN106201510B true CN106201510B (en) 2019-03-01

Family

ID=57474137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610541275.5A Active CN106201510B (en) 2016-07-11 2016-07-11 A kind of communication means of UE4 particIe system and external data

Country Status (1)

Country Link
CN (1) CN106201510B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108762617A (en) * 2018-05-31 2018-11-06 苏州蜗牛数字科技股份有限公司 UI interactive systems, method and storage medium in a kind of VR environment
CN111930362A (en) * 2020-07-23 2020-11-13 上海珀立信息科技有限公司 Prefab development system and creation method based on UE4 platform

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104571993A (en) * 2014-12-30 2015-04-29 北京像素软件科技股份有限公司 Processing method of particle system, display card and mobile application platform
CN105204988A (en) * 2014-06-30 2015-12-30 北京安兔兔科技有限公司 Testing method and system of electronic equipment game performance

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105204988A (en) * 2014-06-30 2015-12-30 北京安兔兔科技有限公司 Testing method and system of electronic equipment game performance
CN104571993A (en) * 2014-12-30 2015-04-29 北京像素软件科技股份有限公司 Processing method of particle system, display card and mobile application platform

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于虚幻4引擎的三维游戏开发实践;朱阅晗等;《艺术科技》;20151231;5,6页

Also Published As

Publication number Publication date
CN106201510A (en) 2016-12-07

Similar Documents

Publication Publication Date Title
CN107844635B (en) System for realizing BIM information and traffic simulation information integration and integration method thereof
CN109961495B (en) VR editor and implementation method thereof
CN106600705B (en) Method in VR about virtual environment and true environment phase Mutual simulation
US20080231627A1 (en) Using Ray Tracing to Enhance Artificial Intelligence Character Behavior
CN106530400A (en) Interactive virtual campus roaming system based on intelligent wearing device
CN110059199A (en) A kind of implementation method and 3D PowerPoint of 3D PowerPoint
CN106201510B (en) A kind of communication means of UE4 particIe system and external data
Wang et al. Inherent noise‐aware insect swarm simulation
Chen et al. Shape‐constrained flying insects animation
Bishop et al. Linking modelling and visualisation for natural resources management
Song et al. TownSim: Agent-based city evolution for naturalistic road network generation
CN107391881A (en) A kind of flue gas method for visualizing based on particIe system grid
CN103208130B (en) Large-scale group performance animation synthetic method and equipment
CN105825024B (en) A method of realizing coke-oven plant&#39;s blasting condensation workshop section cooperating type three-dimensional artificial
Villanueva et al. On building support of digital twin concept for smart spaces
CN110675509A (en) Editable comprehensive simulation method and system based on three-dimensional modeling
Zhang et al. Simulation of snow effects in visual simulation of virtual campus based on OSG
Penney Volumetric clouds in the VR movie, Allumette
CN108921920A (en) A kind of production method of hydroelectric project three-dimensional animation
KR20080018394A (en) Recording medium for recording crowd simulator software for maya
Del Signore et al. Data and Visualization
Dong et al. Smoke simulation based on particle system in virtual environments
WO2024027285A1 (en) Facial expression processing method and apparatus, computer device and storage medium
CN114818072B (en) Virtual building method based on physical simulation system and storage medium
Shen et al. Light Accumulation Map for Natural Foliage Scene Generation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant