After downloading the official fisix documentation, we will find a core class of the fisix class, which contains four classes: collisionobject, fisixengine, fisixobject, and vector, among them, fisixengine is often used, and we need to call it to create a program.
|
Class |
Description |
|
Collisionobject |
The parent of all objects with physical presence. |
|
Fisixengine |
This is the first class that shocould be instancated in your simulation. |
|
Fisixobject |
The main class of the engine. |
|
Vector |
A class which serves as the base for calculation of the engine's calculations |
When we enter the fisixobject class, we will find the relationship between them. collisionobject is the parent class of three core classes. Fisixengine inherits the fisixobject class, so that we can see more clearly.
Package |
Com. fileitup. fisixengine. Core |
Class |
Public final class fisixengine |
Inheritance |
Fisixengine ----> fisixobject -----> collisionobject |
In creating a fisix application, first we need to instantiate a fisixengine, which needs to be created in the program and introduce other objects through it.
Remember when we created the first application, we first introduced VAR myengine: fisixengine =NewFisixengine (); that is to say, we can boldly assume that it is the entry of our program and use the object myengine to reference the example we need. For this assumption, we can leave it right. Let's continue to explore the charm that fisixengine brings to us.
I,CollisionobjectClass
It is a physical symptom class owned by all objects at the parent level. This class is equivalent to an abstract class. It does not represent a special class and cannot be added to an application, that is to say, it cannot be instantiated. On the contrary, it can be used in place of the three categories: particle, surfaces, and polygons.
II,FisixengineClass
The first key class of the core class, which must be added during creation. It contains methods used to add physical objects to an instance and associate any displayobject class objects to engine simulation. You can use two methods to start the engine.
For example, fisixengine. startengine () or fisixengine. mainloop (DT) renders each frame.
3,FisixobjectClass
The main category of the core class. As the main engine class, it is used to add a group of objects to the engine. In order to achieve good results, we can form a bike (fisixobject) object, which contains two wheels (specifically lewheels), one body for fixing two wheels, and one control disk.
IV,VectorClass
We can think of it as Vector class processing. It is used to store two values, X and Y.