Flash physical engine application: core category of fisix Application

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.