Dbox2使用手册
- 格式:pdf
- 大小:2.08 MB
- 文档页数:15


BedienungsanleitungDigiswitchV2Sehr geehrter Kunde,wir freuen uns, dass Sie sich für den PowerBox DigiSwitch V2 aus unserem Sor-timent entschieden haben. Wir wünschen Ihnen mit der PowerBox DigiSwitch V2 viel Freude und Erfolg!PRODUKTBESCHREIBUNGDer PowerBox DigiSwitch V2 ist die zweite Generation des weltweit bekannten PowerBox DigiSwitch. Der PowerBox DigiSwitch ist aufgrund seiner kompakten Bauform und der vielseitigen Einsatzmöglichkeiten schon seit gut 15 Jahren der Standard in kleinen bis mittelgroßen Modellen.Der DigiSwitch V2 konnte dank dem Einsatz modernster Bauelemente um ganze 20 % verkleinert werden.Durch den Einsatz eines edlen, gefrästen und eloxierten Aluminiumgehäuses wur-de die nutzbare Kühlleistung deutlich erhöht – der PowerBox DigiSwitch V2 kann ca. 20 % mehr Dauerstrom leisten! Die kurzzeitige Belastbarkeit hat sich sogar ver-doppelt – über mehrere Sekunden verkraftet der DigiSwitch V2 über 10 A!Der DigiSwitch V2 hat vier wählbare Ausgangsspannungen – für normale Servos kann auf 6,0 V geregelt werden, für HV Servos stehen geregelte 7,0 V, 7,6 V oder eine Option ohne Regelung zur Verfügung.Als Stromversorgung kann zwischen vier verschiedenen Akkutypen gewählt wer-den: LiPo, LiIon, LiFePo und NiMh. Zur Spannungsanzeige der Akkus kommen ul-trahelle RGB LED´s zum Einsatz, die mit verschiedenen Farben den Ladestatus der Akkus signalisieren.Für CORE Kunden gibt es noch ein besonderes Feature oben drauf: die Akku- und Reglerspannungen können per Telemetrie direkt auf dem Sender angezeigt wer-den!FEATURES+ Leistungsstarker elektronischer Schalter+ Sehr leichte und kompakte Bauform+ Geregelte Ausgangsspannung+ Einstellbare Ausgangsspannung 6,0 V, 7,0 V, 7,6 V oder ungeregelt+ RGB-LED-Spannungsanzeige für die Batterie+ Telemetrie-Unterstützung für die CORE+ 4 Akkutypen werden unterstützt: 2s LiPo, 2s LiIon, 2s LiFePo and 5s NiMH+ Reglerüberwachung+ Unterdrückung von Servo-Rückströmen1. AUFBAU UND ANSCHLÜSSE2. EINBAU UND ANSCHLIESSEN DER AKKUSDer PowerBox DigiSwitch V2 wird an einer schwingungsarmen Stelle im Modell eingebaut. Reine GfK-Seitenwände eines Motormodells sollten mit einem 3 – 4 mm starken Sperrholzbrett, das von innen eingeklebt wird, gestützt werden, um Vibrati-onen zu minimieren und den Schrauben sicheren Halt zu geben.Stecken Sie einen Akku Ihrer Wahl – richtig gepolt – an den Akkueingang an. Es können 2s LiPo/LiIon, 2s LiFePo oder 5s NiMH Akkus verwendet werden. Wir emp-fehlen Ihnen den Einsatz der PowerPak 2.5x2 Pro Akkus, die dank der integrierten Ladetechnik besonders sicher und einfach in der Handhabung sind.Akkuanschluss (MPX oder JR)ZustandsanzeigeTelemetriean-CORE P²BUSHinweis bei selbst konfigurierten Akkupacks: Wird der Akku falsch gepolt an-gesteckt, sind die eingebauten Linear- Regler sofort zerstört!Der Ausgang des DigiSwitch wird am Akku Eingang oder in einen freien Steckplatz im Empfänger eingesteckt.Sollte kein Servoausgang mehr frei sein, kann ein V-Kabel an einen Servoausgang angesteckt werden, um den DigiSwitch V2 und das Servo anzuschließen.Beim CORE System verfahren Sie wie oben, das Kabel mit der einzelnen Signallei-tung wird in den P²BUS Eingang des Empfängers gesteckt.3. EIN- UND AUSSCHALTVORGANGWie beim Vorgängermodell und allen PowerBox Geräten mit einer Taste ist der Ein- und Ausschaltvorgang wie folgt:Drücken Sie die Taste ein bis zwei Sekunden, bis die LED´s violett leuchten, lassen Sie die Taste kurz los und bestätigen Sie mit einem zweiten, kurzen Tastendruck den Schaltvorgang.Einmal eingeschaltet kann der Schalter nur wieder mit dem Taster ausgeschaltet werden. Wackelkontakte oder Unterbrechungen während des Betriebes führen nicht zu einem Ausschalten der PowerBox. Der letzte Schaltzustand wird immer abgespeichert.4. EINSTELLEN DER AKKUANZEIGEDamit die LED Akkuanzeige richtig funktioniert, müssen Sie den Akkutyp einstellen. Dazu schalten Sie zuerst die PowerBox ein. Jetzt drücken Sie erneut die Taste und halten diese gedrückt.Nach ca. 5 Sekunden schalten sich die LED´s aus und eine Sequenz mit verschie-denen Farben beginnt. Jede Farbe ist einem Akkutyp zugeordnet. Lassen Sie die Taste los, wenn die Farbe angezeigt wird, die Ihrem Akkutyp entspricht. Der Akku-typ wird damit abgespeichert.Information zur LED Anzeige: Die Anzeige ist nicht linear zur Akkuspannung. Es wurden verschiedene gängige Akkutypen vermessen, die im Mittel eine Entlade-kurve ergeben. Diese Entladekurve wird verwendet, um eine prozentuale Anzeige zu ermöglichen.Die LED Anzeige hat folgende Bedeutung für den Akkuinhalt:80 – 100 %60 – 80 %40 – 60 %20 – 40 %0 – 20 % 5. EINSTELLEN DER AUSGANGSSPANNUNGDer PowerBox DigiSwitch V2 kann auf zwei verschiedene Ausgangsspannungen eingestellt werden: zum einen auf 6,0 V für reguläre Servos und zum anderen auf 7,0 V, 7,6 V oder ganz ungeregelt für HV Servos. Achten Sie bei dieser Einstellung darauf, dass alle angeschlossenen Komponenten hochvolt-tauglich sind.Ein Vorteil daran, die Spannung auf 7,6 V zu regeln, statt die Akkuspannung einfach durchzulassen, besteht darin, dass die anfänglich nach dem Laden vorhandene hohe Akkuspannung ausgeregelt wird. Somit erhält man von Anfang an eine kons-tante Spannung und damit eine länger gleichbleibende Servogeschwindigkeit- und Kraft.Zum Umstellen der Ausgangsspannung drücken Sie die Taste und stecken bei ge-drückter Taste den Akku ein. Die LED wird zuerst grün leuchten, nach 3 Sekunden rot. Je nachdem, bei welcher Farbe Sie loslassen, stellt sich die Ausgangsspan-nung um. Dabei bedeutet grün = 6,0 V, orange = 7,0 V, violett = 7,6 V und rot = ungeregelt.Abschließend blinkt die LED weiß, um den Einstellvorgang zu bestätigen.Hinweise zur Reglerleistung:Der maximale Strom, den der PowerBox DigiSwitch V2 abgeben kann, ist von äu-ßeren Faktoren wie Akkutyp, eingestellter Ausgangsspannung, und auch stark von der Kühlung abhängig. Im Idealfall ist die Weiche außen am Modell angebracht oder innen so verbaut, dass zumindest ein leichter Fahrtwind für Kühlung sorgt. Besonders wenn der DigiSwitch V2 mit LiPo/LiIon Zellen mit 6,0 V Ausgangsspan-nung betrieben wird, sollte die Anzahl der angeschlossenen Servos im empfohle-nen Rahmen bleiben. Wobei auch hier gilt, dass z.B. 6 kleine Flächenservos weniger Leistung brauchen als 4x 30 kg Servos.In der 7,6 V oder offenen Einstellung muss der DigiSwitch kaum oder gar nicht regeln und Energie vernichten. Damit steigt die Ausgangsleistung des PowerBox DigiSwitch V2 deutlich an! Das gleiche gilt für die 6,0 V Einstellung, wenn LiFePo oder NiMh Akkus verwendet werden, die bereits mit niedriger Eingangsspannung an dem Eingang des DigiSwitch angeschlossen werden.Sollten Sie sich nicht sicher sein, ob der PowerBox DigiSwitch V2 Ihren Stroman-forderungen gewachsen ist, bewegen Sie alle Servos am Boden für ca. 30 Sekun-den. Sollte sich der DigiSwitch stark erhitzen (über 60 °C), sollten Servos, Gestänge und Anlenkungen überprüft werden. Ist hier alles in Ordnung, sollte die für größere Leistungen konzipierte PowerBox Sensor verwendet werden.6. REGLERFEHLERDer Spannungsregler wird ständig auf Funktion überwacht. Sollte sich die Aus-gangsspannung außerhalb der Sollspannung befinden, wird das durch schnelles violettes Blinken der LED´s angezeigt. Reglerfehler treten z.B. nach verpoltem Ein-stecken der Akku auf.In dem Fall wenden Sie sich bitte an den Service!7. TECHNISCHE DATENBetriebsspannung: 4,0 V – 9,0 VStromversorgung: 2s LiPo, 2s LiIon, 2s LiFePo, 5s NiMh Stromaufnahme Betrieb: 23 mAStromaufnahme Standby: 4 μAStrombelastbarkeit Spitze: 10 ADropout Spannung: 0,1 VAusgangsspannung: 6,0 V/ 7,0 V/7,6 V stabilisiert oder ungeregelt Unterstützes Telemetriesystem: P²BUSAbmessungen: 50 x 18 x 11 mmGewicht: 15 gTemperaturbereich: -30 °C bis +105 °C8. ABMESSUNGEN9. LIEFERUMFANG- PowerBox DigiSwitch V2- 2x Befestigungsschrauben- Bedienungsanleitung in Deutsch und Englisch10. SERVICEHINWEISUm unseren Kunden guten Service bieten zu können, wurde ein Support Forum für alle Fragen, die unsere Produkte betreffen, eingerichtet. Das entlastet uns stark, um nicht immer wieder häufig auftretende Fragen erneut beantworten zu müssen, und gibt Ihnen die Möglichkeit, schnelle Hilfe rund um die Uhr und auch an Wochenen-den zu erhalten. Die Antworten sind vom PowerBox Team, das garantiert auch die Richtigkeit der Antworten.Nutzen Sie bitte das Support Forum bevor Sie uns telefonisch kontaktieren.Sie finden das Forum unter folgender Adresse:SERVICE ADRESSE PowerBox-Systems GmbH Ludwig-Auer-Straße 5D-86609 Donauwörth11. GARANTIEBESTIMMUNGENPowerBox-Systems legt bei der Entwicklung und der Fertigung besonderen Wert auf höchsten Qualitätsstandard, garantiert …Made in Germany“!Wir gewähren deshalb auf den PowerBox DigiSwitch V2 eine Garantie von 24 Mo-naten ab dem Verkaufsdatum. Die Garantie besteht darin, dass nachgewiesene Materialfehler von uns kostenlos behoben werden. Wir weisen vorsorglich darauf hin, dass wir uns vorbehalten, das Gerät auszutauschen, wenn eine Reparatur aus wirtschaftlichen Gründen nicht möglich ist.Eventuelle Reparaturen, die wir für Sie in unserem Service durchgeführt haben, ver-längern den Gewährleistungszeitraum nicht.Falsche Anwendung, z.B. durch Verpolung, sehr starke Vibrationen, zu hohe Span-nung, Nässe, Kraftstoff, Kurzschluss, schließt Garantieansprüche aus. Für Mängel, die auf besonders starke Abnutzung beruhen, gilt dies ebenfalls.Für Transportschäden und Verlust Ihrer Sendung können wir keine Haftung über-nehmen. Im Gewährleistungsfall senden Sie uns das Gerät zusammen mit dem Kaufbeleg und einer Fehlerbeschreibungan die folgende Adresse:12. HAFTUNGSAUSSCHLUSSSowohl die Einhaltung der Montagehinweise als auch die Bedingungen beim Be-trieb des PowerBox DigiSwitch V2, sowie die Wartung der gesamten Fernsteue-rungsanlage, können von uns nicht überwacht werden.Daher übernehmen wir keinerlei Haftung für Verluste, Schäden oder Kosten, die sich aus der Anwendung und aus dem Betrieb des PowerBox DigiSwitch V2 erge-ben oder in irgendeiner Weise damit zusammen hängen können. Soweit es gesetz-lich zulässig ist, wird die Pflicht zur Schadensersatzleistung, gleich aus welchen rechtlichen Gründen, auf den Rechnungsbetrag der Produkte aus unserem Haus, die an dem Ereignis beteiligt sind, begrenzt.Wir wünschen Ihnen Erfolg beim Einsatz mit Ihrem neuen PowerBox DigiSwitch V2! Donauwörth, Dezember 2020。
Box2DFlash v2.0.2User manualLargely cribbed unauthorized from the Box2D manual,copyright2007-2009Erin Catto. AboutBox2DFlash is a2D rigid body simulation library for games.Programmers can use it in their games to make objects move in believable ways and make the world seem more interactive.From the game's point of view a physics engine is just a system for procedural animation.Rather than paying(or begging)an animator to move your actors around,you can let Sir Isaac Newton do the directing.Box2DFlash is written in AS3,and resides in the Box2d namespace.Most of the types defined in the engine begin with the b2prefix,to match the C++version.PrerequisitesIn this manual I'll assume you are familiar with basic physics concepts,such as mass, force,torque(扭转力),and impulses(推力).If not,please first consult(翻阅)the many tutorials provided by Chris Hecker and David Baraff(google these names).You do not need to understand their tutorials in great detail,but they do a good job of laying out the basic concepts that will help you use Box2D.Wikipedia is also an excellent source of physics and mathematics knowledge.In some ways it is more useful than Google,because it has carefully crafted content.This is not a prerequisite,but if you are curious about the inner workings of Box2D,you can look at these articles.Since Box2DAS3is written in Actionscript3,you are expected to be experienced in this.If you come from an AS2background,you may find it easier to start on an easier project before using Box2D,but it is not impossible.Core ConceptsBox2D works with several fundamental objects.We briefly define these objects here and more details are given later in this document.rigid body(刚体)A chunk of matter(物质)that is so strong that the distance between any two bits ofmatter on the chunk is completely constant.They are hard like a diamond.In the following discussion we use body interchangably with rigid body.shapeA2D piece of collision geometry that is rigidly attached to a body.Shapes have material properties of friction and restitution.(依附于body的2d碰撞几何结构,具有摩擦和恢复特性)Constraint(约束)A constraint is a physical connection that removes degrees of freedom from bodies.In2D a body has3degrees of freedom.If we take a body and pin it to the wall(like a pendulum)we have constrained the body to the wall.At this point the body can only rotate about the pin,so the constraint has removed2degrees of freedom.contact constraint(接触约束)A special constraint designed to prevent penetration(穿透)of rigid bodies and tosimulate(模仿)friction and restitution.You will never create a contact constraint,they are created automatically by Box2D.jointThis is a constraint used to hold two or more bodies together.Box2D supports these joint types:revolute,prismatic,distance,and more.Joints may support limits and motors.joint limitA joint limit restricts the range of motion of a joint.For example,the human elbow onlyallows a certain range of angles.joint motorA joint motor drives the motion of the connected bodies according to the joint'sdegrees of freedom.For example,you can use a motor to drive the rotation of an elbow.worldA physics world is a collection of bodies,shapes,and constraints that interact together.Box2D supports the creation of multiple worlds,but this is usually not necessary or desirable.Hello Box2DThis is a small example program that creates a large ground box and a small dynamic box. This code does not contain any graphics,so prepare to be underwelmed.:).The matching documents for this example have yet to be created.Creating a WorldEvery Box2D program begins with the creation of a world object.This is the physics hub that manages objects,and simulation.To create a world object,first we need to define a bounding box for the world.Box2D uses the bounding box to accelerate collision detection.The size isn't critical,but a better fit will improve performance.It is better to make the box too big than to make it too small.view sourceprint?1varworldAABB:b2AABB=newb2AABB();2worldAABB.lowerBound.Set(-100.0,-100.0);3worldAABB.upperBound.Set(100.0,100.0);CautionThe world AABB should always be bigger then the region where your bodies are located. It is better to make the world AABB too big than too small.If a body reaches the boundary of the world AABB it will be frozen and will stop simulating.Next we define the gravity vector.Yes,you can make gravity go sideways(or you could just rotate your monitor).Also we tell the world to allow bodies to sleep when they come to rest.A sleeping body doesn't require any simulation.view sourceprint?1vargravity:b2Vec2=newb2Vec2(0.0,-10.0);2vardoSleep:Boolean=true;Now we create the world object.view sourceprint?1varworld:b2World=newb2World(worldAABB,gravity,doSleep);So now we have our physics world,let's start adding some stuff to it.Creating a Ground BoxBodies are built using the following steps:1Define a body with a position,damping,etc.2Use the world object to create the body.3Define shapes with geometry,friction,density,etc.4Create shapes on the body.5Optionally adjust the body's mass to match the attached shapes.For step1we create the ground body.For this we need a body definition.With the body definition we specify the initial position of the ground body.view sourceprint?1vargroundBodyDef:b2BodyDef=newb2BodyDef();2groundBodyDef.position.Set(0.0,-10.0);For step2the body definition is passed to the world object to create the ground body. The world object does not keep a reference to the body definition.The ground body is created as a static body.Static bodies don't collide with other static bodies and are immovable.Box2D determines that a body is static when it has zero mass.Bodies have zero mass by default,therefore they are static by default.view sourceprint?1vargroundBody:b2Body=world.CreateBody(groundBodyDef);For step3we create a ground polygon definition.We use the SetAsBox shortcut to formthe ground polygon into a box shape,with the box centered on the origin of the parent body.view sourceprint?1vargroundShapeDef:b2PolygonDef=newb2PolygonDef();2groundShapeDef.SetAsBox(50.0,10.0);The SetAsBox function takes the half-width and half-height.So in this case the ground box is100units wide(x-axis)and20units tall(y-axis).Box2D is tuned for meters, kilograms,and seconds.So you can consider the extents to be in meters.However,it is possible to change unit systems,as discussed later in this document.We finish the ground body in step4by creating the ground polygon shape on the ground body.view sourceprint?1groundBody.CreateShape(groundShapeDef);Again,Box2D does not keep a reference to the shape or body definitions.It copies the data into the b2Body structure.Note that every shape must have a parent body,even shapes that are static.However, you can attach all static shapes to a single static body.This need for static bodies is done to make the Box2D code more uniform internally,reducing the number of potential bugs.You might notice a pattern here.Most Box2D types are prefixed with b2.This is done to reduce the chance for naming conflicts with your code.Creating a Dynamic BodySo now we have a ground body.We can use the same technique to create a dynamic body.The main difference,besides dimensions,is that we must establish the dynamic body's mass properties.First we create the body using CreateBody.view sourceprint?1varbodyDef:b2BodyDef=newb2BodyDef();2bodyDef.position.Set(0.0,4.0);34varbody:b2Body=world.CreateBody(bodyDef);Next we create and attach a polygon shape.Notice that we set density to1.The default density is zero.Also,the friction on the shape is set to0.3.Once the shape is attached, we instruct the body to compute it's mass properties from the attached shapes using the method SetMassFromShapes.This gives you a hint that you can attach more than one shape per body.If the computed mass is zero,then the body becomes truly static.Bodies have a mass of zero by default,that's why we didn't need to call SetMassFromShapes for the ground body.view sourceprint?1varshapeDef:b2PolygonDef=newb2PolygonDef();2shapeDef.SetAsBox(1.0,1.0);3shapeDef.density=1.0;4shapeDef.friction=0.3;5body.CreateShape(shapeDef);6body.SetMassFromShapes();That's it for initialization.We are now ready to begin simulating.Simulating the World(of Box2D)So we have initialized the ground box and a dynamic box.Now we are ready to set Newton loose to do his thing.We just have a couple more issues to consider.Box2D uses a bit of numerical code called an integrator.Integrators simulate the physics equations at discrete points of time.This goes along with the traditional game loop where we essentially have a flip book of movement on the screen.So we need to pick a time step for Box2D.Generally physics engines for games like a time step at least as fast as60Hz or1/60seconds.You can get away with larger time steps,but you will have to be more careful about setting up the definitions for your world.We also don't like the time step to change much.So don't tie the time step to your frame rate(unless you really,really have to).Without further ado,here is the time step.view sourceprint?1vartimeStep:Number=1.0/60.0;In addition to the integrator,Box2D also uses a larger bit of code called a constraint solver.The constraint solver solves all the constraints in the simulation,one at a time.A single constraint can be solved perfectly.However,when we solve one constraint,we slightly disrupt other constraints.To get a good solution,we need to iterate over all constraints a number of times.The suggested iteration count for Box2D is10.You can tune this number to your liking,just keep in mind that this has a trade-off between speed and ing fewer iterations increases performance but accuracy suffers. Likewise,using more iterations decreases performance but improves the quality of your simulation.Here is our chosen iteration count.view sourceprint?1variterations:Number=10;Note that the time step and the iteration count are completely unrelated.An iteration is not a sub-step.One iteration is a single pass over all the constraints withing a time step. You can have multiple passes over the constraints within a single time step.We are now ready to begin the simulation loop.In your game the simulation loop can be merged with your game loop.In each pass through your game loop you call b2World.Step.Just one call is usually enough,depending on your frame rate and your physics time step.The Hello World program was designed to be dead simple,so it has no graphical output. Rather that being utterly boring by producing no output,the code prints out the position and rotation of the dynamic body.Yay!Here is the simulation loop that simulates60time steps for a total of1second of simulated time.view sourceprint?1for(vari:Number=0;i<60;++i)23{4world.Step(timeStep,iterations);5varposition:b2Vec2=body.GetPosition();6varangle:Number=body.GetAngle();7trace(position.x+','+position.y+','+angle);89}The TestbedOnce you have conquered the HelloWorld example,you should start looking at Box2DAS3's testbed.The testbed is a unit-testing framework and demo environment. Here are some of the features:•Mouse picking of shapes attached to dynamic bodies.•Extensible set of tests.The testbed has many examples of Box2D usage in the test cases and the framework itself.I encourage you to explore and tinker with the testbed as you learn Box2D.API DesignMemory ManagementBox2dFlash is a straight port of Box2D,a C++library.Hence in many places,memory is managed precisely,rather than relying on the garbage collector.This helps reduce stutter. Objects are recycled,hence the many Create/Destroy methods.Factories and DefinitionsAs mentioned above,memory management plays a central role in the design of the Box2D API.So when you create a b2Body or a b2Joint,you need to call the factoryfunctions on b2World.There are creation functions:view sourceprint?1b2World.CreateBody(def:b2BodyDef):b2Body2b2World.CreateJoint(def:b2JointDef):b2JointAnd there are corresponding destruction functions:view sourceprint?1b2World.DestroyBody(body:b2Body):void23b2World.DestroyJoint(joint:b2Joint):voidWhen you create a body or joint,you need to provide a definition or def for short. These definitions contain all the information needed to build the body or joint.By using this approach we can prevent construction errors,keep the number of function parameters small,provide sensible defaults,and reduce the number of accessors.Since shapes must be parented to a body,they are created and destroyed using a factory method on b2Body:view sourceprint?1b2Body.CreateShape(def:b2ShapeDef):b2Shape2b2Body.DestroyShape(shape:b2Shape):voidFactories do not retain references to the definitions.So you can create definitions on the stack and keep them in temporary resources.UnitsBox2D works with floating point numbers,so some tolerances have to be used to make Box2D perform well.These tolerance have been tuned to work well with meters-kilogram-second(MKS)units.In particular,Box2D has been tuned to work well with moving objects between0.1and10meters.So this means objects between soup cans and buses in size should work well.Being a2D physics engine it is tempting to use pixels as your units.Unfortunately this will lead to a poor simulation and possibly weird behavior.An object of length200pixels would be seen by Box2D as the size of a45story building.Imagine trying to simulate the movement of a high-rise building with an engine that is tuned to simulate ragdolls and barrels.It isn't pretty.***Caution***Box2D is tuned for MKS units.Keep the size of moving objects roughly between0.1and10meters.You'll need to use some scaling system when you render your environment and actors.The built in DebugDraw already features a scaling factor.User DataThe b2Shape,b2Body,and b2Joint classes allow you to attach any object as user data. This is handy when you are examining Box2D data structures and you want to determine how they relate to the data structures in your game engine.For example,it is typical to attach an actor to the rigid body on that actor.This sets up a circular reference.If you have the actor,you can get the body.If you have the body,you can get the actor.view sourceprint?1actor:GameActor=newGameCreateActor();2bodyDef:b2BodyDef=newb2BodyDef();erData=actor;4actor.body=box2Dworld.CreateBody(bodyDef);Here are some examples of cases where you would need the user data:•Applying damage to an actor using a collision result.•Playing a scripted event if the player is inside an axis-aligned box.•Accessing a game structure when Box2D notifies you that a joint is going to be destroyed.Keep in mind that user data is optional and you can put anything in it.However,you should be consistent.For example,if you want to store an actor on one body,you should probably keep an actor on all bodies.StrawmanIf you don't like this API design,that's ok!You have the source code!Seriously,if you have feedback about anything related to Box2D,please leave a comment in the forum.The WorldAboutThe b2World class contains the bodies and joints.It manages all aspects of the simulation and allows for asynchronous queries(like AABB queries).Much of your interactions with Box2D will be with a b2World object.Creating and Destroying a WorldCreating a world is fairly simple.You need to provide a bounding box and a gravity vector.The axis-aligned bounding box should encapsulate the world.You can improve performance by making the bounding box a bit bigger than your world,say2x just to be safe.If you have lots of bodies that fall into the abyss,your application should detect this and remove the bodies.This will improve performance and prevent floating point overflow.view sourceprint?1varmyWorld:b2World=newb2World(aabb,gravity,doSleep)When myWorld goes out of use,it will automatically be deleted by the garbage collector.CautionRecall that the world AABB should always be bigger then the region where your bodies are located.If bodies leave the world AABB,then they will be frozen.This is not a bug.Using a WorldThe world class contains factories for creating and destroying bodies and joints.These factories are discussed later in the sections on bodies and joints.There are some other interactions with b2World that I will cover now.SimulationThe world class is used to drive the simulation.You specify a time step and an iteration count.For example:view sourceprint?1vartimeStep:Number=1.0/60.;2variterationCount:Number=10;3myWorld.Step(timeStep,iterationCount);After the time step you can examine your bodies and joints for information.Most likely you will grab the position off the bodies so that you can update your actors and render them.You can perform the time step anywhere in your game loop,but you should be aware of the order of things.For example,you must create bodies before the time step if you want to get collision results for the new bodies in that frame.As I discussed above in the HelloWorld tutorial,you should use a fixed time step.By using a larger time step you can improve performance in low frame rate scenarios.But generally you should use a time step no larger than1/30seconds.A time step of1/60 seconds will usually deliver a high quality simulation.The iteration count controls how many times the constraint solver sweeps over all the contacts and joints in the world.More iterations always yields a better simulation.But don't trade a small time step for a large iteration count.60Hz and10iterations is far better than30Hz and20iterations.Exploring the WorldAs mentioned before,the world is a container for bodies and joints.You can grab the body and joint lists off the world and iterate over them.For example,this code wakes up all the bodies in the world.view sourceprint?1for(varb:b2Body=myWorld.GetBodyList();b;b=b.GetNext())23{4 b.WakeUp();5}Unfortunately life can be more complicated.For example,the following code is broken:view sourceprint?01for(varb:b2Body=myWorld.GetBodyList();b;b=b.GetNext())0203{04varmyActor:GameActor=b->GetUserData()asGameActor;05if(myActor.IsDead())06{07myWorld.DestroyBody(b);//ERROR:now GetNext returns garbage. 0809}10}Everything goes ok until a body is destroyed.Once a body is destroyed,its next pointer becomes invalid.So the call to b2Body.GetNext()will return garbage.The solution to this is to copy the next body before destroying the body.view sourceprint?01varnode:b2Body=myWorld.GetBodyList();02while(node)0304{05varb:b2Body=node;06node=node.GetNext();0708varmyActor:GameActor=b->GetUserData()asGameActor;09if(myActor.IsDead())1011{12myWorld.DestroyBody(b);13}14}This safely destroys the current body.However,you may want to call a game function that may destroy multiple bodies.In this case you need to be very careful.The solution is application specific,but for convenience I'll show one method of solving the problem.view sourceprint?01varnode:b2Body=myWorld.GetBodyList();02while(node)0304{05varb:b2Body=node;06node=node.GetNext();0708varmyActor:GameActor=b.GetUserData()asGameActor;09if(myActor.IsDead())1011{12varotherBodiesDestroyed:Boolean=GameCrazyBodyDestroyer(b); 13if(otherBodiesDestroyed)14{1516node=myWorld.GetBodyList();17}18}19}Obviously to make this work,GameCrazyBodyDestroyer must be honest about what it has destroyed.AABB QueriesSometimes you want to determine all the shapes in a region.The b2World class has a fast log(N)method for this using the broad-phase data structure.You provide an AABB in world coordinates and b2World returns an array of all the shapes that potentially intersect the AABB.This is not exact because what the function actually does is return all the shapes whose AABBs intersect the specified AABB.For example,the following code finds all the shapes that potentially intersect a specified AABB and wakes up all of the associated bodies.view sourceprint?01varaabb:b2AABB=newb2AABB();02aabb.lowerBound.Set(-1.0,-1.0);03aabb.upperBound.Set(1.0,1.0);0405vark_bufferSize:Number=10;06varbuffer:Array=[];07varcount:Number=myWorld.Query(aabb,buffer,k_bufferSize);0809for(vari:Number=0;i<count;++i)10{11buffer[i].GetBody().WakeUp();1213}Note:This calling syntax is rather obscure for typical AS3use.This is due to Box2DAS3's C++heritage,which does not handle variable sized arrays so easily.BodiesAboutBodies have position and velocity.You can apply forces,torques,and impulses to bodies. Bodies can be static or dynamic.Static bodies never move and don't collide with other static bodies.Bodies are the backbone for shapes.Bodies carry shapes and move them around in the world.Bodies are always rigid bodies in Box2D.That means that two shapes attached to the same rigid body never move relative to each other.You usually keep pointers to all the bodies you create.This way you can query the body positions to update the positions of your graphical entities.You should also keep body pointers so you can destroy them when you are done with them.Body DefinitionBefore a body is created you must create a body definition(b2BodyDef).You can create a body definition on the stack or build it into your game's data structures.The choice is up to you.Box2D copies the data out of the body definition,it does not keep a pointer to the body definition.This means you can recycle a body definition to create multiple bodies.Lets go over some of the key members of the body definition.Mass PropertiesThere are a few ways to establish the mass properties for a body.6Set the mass properties explicitly in the body definition.7Set the mass properties explicitly on the body(after it has been created).8Set the mass properties based on the density of the attaced shapes.In many game scenarios it makes sense to compute mass based on shape densities.This helps to ensure that bodies have reasonable and consistent mass values.However,other game scenarios may require specific mass values.For example,you may have a mechanism,like a scale that needs precise mass values.You can explicitly set the mass properties in the body definition as follows:view sourceprint?1bodyDef.massData.mass=2.0;//the body's mass in kg23bodyDef.massData.center.SetZero();//the center of mass in local coordinates4bodyDef.massData.I=3.0;//the rotational inertia in kg*m^2.The other methods of setting the mass properties are covered elsewhere in this document.Position and AngleThe body definition gives you the chance to initialize the position of the body on creation. This has better performance than creating the body at the world origin and then moving the body.A body has two main points of interest.The first point is the body's origin.Shapes and joints are attached relative to the body's origin.The second point of interest is the center of mass.The center of mass is determined from mass distribution of the attached shapes or is explicitly set with b2MassData.Much of Box2D's internal computations use the center of mass position.For example b2Body stores the linear velocity for the center of mass.When you are building the body definition,you may not know where the center of mass is located.Therefore you specify the position of the body's origin.You may also specify the body's angle in radians,which is not affected by the position of the center of mass.If you later change the mass properties of the body,then the center of mass may move on the body,but the origin position does not change and the attached shapes and joints do not move.view sourceprint?1bodyDef.position.Set(0.0,2.0);//the body's origin position.2bodyDef.angle=0.25*b2Settings.b2_pi;//the body's angle in radians.DampingDamping is used to reduce the world velocity of bodies.Damping differs from friction in that friction only occurs when two surfaces are in contact.Damping is also much cheaper to simulate than friction.Note,however,that damping is not a replacement for friction; the two effects should be used together.Damping parameters should be between0and infinity,with0meaning no damping,and infinity meaning full damping.Normally you will use a damping value between0and1.0.I generally do not use linear damping because it makes bodies look floaty.view sourceprint?1bodyDef.linearDamping=0.0;2bodyDef.angularDamping=0.1;Damping is approximated for stability and performance.At small damping values the damping effect is mostly independent of the time step.At larger damping values,the damping effect will vary with the time step.This is not an issue if you use a fixed time step(recommended).Sleep ParametersWhat does sleep mean?Well it is expensive to simulate bodies,so the less we have to simulate the better.When a body comes to rest we would like to stop simulating it.When Box2D determines that a body(or group of bodies)has come to rest,the body enters a sleep state which has very little CPU overhead.If an awake body collides with a sleeping body,then the sleeping body wakes up.Bodies will also wake up if a joint or contact attached to them is destroyed.You can also wake a body manually.The body definition lets you specify whether a body can sleep and whether a body is created sleeping.view sourceprint?1bodyDef.allowSleep=true;2bodyDef.isSleeping=false;BulletsGame simulation usually generates a sequence of images that are played at some frame rate.In this setting rigid bodies can move by a large amount in one time step.If a physics engine doesn't account for the large motion,you may see some objects incorrectly pass through each other.This effect is called tunneling.By default,Box2D uses continuous collision detection(CCD)to prevent dynamic bodies from tunneling through static bodies.This is done by sweeping shapes from their old position to their new positions.The engine looks for new collisions during the sweep andcomputes the time of impact(TOI)for these collisions.Bodies are moved to their first TOI and then simulated to the end of the original time step.This process is repeated as necessary.Normally CCD is not used between dynamic bodies.This is done to keep performance reasonable.In some game scenarios you need dynamic bodies to use CCD.For example, you may want to shoot a high speed bullet at a thin wall.Without CCD,the bullet my tunnel through the wall.Fast moving objects in Box2D are called bullets.You should decide what bodies should be bullets based on your game design.If you decide a body should be treated as a bullet, use the following setting.view sourceprint?1bodyDef.isBullet=true;The bullet flag only affects dynamic bodies.CCD is expensive so you probably don't want all moving bodies to be bullets.So by default Box2D only uses CCD between moving bodies and static bodies.This is an effective approach to prevent bodies from escaping your game world.However,you may have some fast moving bodies that that require CCD all the time.Body FactoryBodies are created and destroyed using a body factory provided by the world class.This lets the world create the body with an efficient allocator and add the body to the world data structure.Bodies can be dynamic or static depending on the mass properties.Both body types use the same creation and destruction methods.view sourceprint?1vardynamicBody:b2Body=myWorld.CreateBody(bodyDef);23//...do stuff...4myWorld.DestroyBody(dynamicBody);5dynamicBody=null;Static bodies do not move under the influence of other bodies.You may manually move static bodies,but you should be careful so that you don't squash dynamic bodies between two or more static bodies.Friction will not work correctly if you move a static body.Static bodies never simulate on their own and they never collide with other static bodies.It is faster to attach several shapes to a static body than to create several static bodies with a single shape on each one.Internally,Box2D sets the mass and inverse mass of static bodies to zero.This makes the math work out so that most algorithms。
快速入门教程目录下载、安装以及运行2BizBox下载、安装2BizBox运行服务器程序运行客户端程序登录2BizBox退出以及注销2BizBox预备知识创建零件创建物料清单创建销售单添加客户地址簿添加销售单审批销售单计划—制造或外购创建工单审批工单工单排产运行物料需求计划创建采购单审批采购单采购单收料创建应付账款付款工单发料工单收料销售单发货创建应收账款收款欢迎光临2BizBox快速入门教程!您可在阅读本教程同时,先观看配套操作视频,以便更直观了解2BizBox工作原理:快速上手操作视频2BizBox是功能全面、易于使用的免费ERP软件,此教程可帮助您快速完成2BizBox基础设置,并初步了解2BizBox的主要流程。
本教程的内容可在30分钟内完成,在您完成本教程并熟悉了2BizBox之后,您可进入在线用户手册,详细了解2BizBox各种有趣而强大的功能。
本教程只需要一台装有任意版本Windows操作系统的电脑来安装2BizBox,Microsoft Excel和Adobe Reader软件来阅读系统打印的PDF文件,无需数据库、Java或者其他软件的安装部署。
从官网下载2BizBox安装程序。
如果您下载的是“All In One”安装程序,可在下载完成后,根据“安装向导”的提示进行安装,确保“全部”选项(此选项包含2BizBox ERP的服务器和客户端)在安装过程中被选中。
如果您下载的是ZIP压缩文件, 直接解压缩安装包,找到相应的“run.bat”运行服务器,以及“client.exe”运行客户端即可。
双击“2BizBox服务器”即可运行2BizBox服务器程序。
请确保计算机上的80端口未被其他程序占用,以便2BizBox服务器能够正确启动。
服务器程序启动后,会有两个命令提示窗口运行,“run_database.bat”运行MySQL数据库服务,使用端口3307;“run.bat”是2BizBox 运行的后台程序JBoss服务。
TriBoxII工控机操作手册1.0版德国TriOS(中国)技术服务中心目 录1.安全规则 (1)1.1.操作安全 (1)1.1.1抗干扰 (1)1.2.证书与认证 (1)1.2.1 一致性声明 (1)1.2.2 附加认证 (1)2.装配 (2)2.1.安装尺寸 (2)2.2.安装要求 (3)2.3.附件:TriBox2户外保护箱 (3)3.电路连接 (4)3.1.外部连接 (4)3.2.拆机作业 (5)3.3.输入/输出接口 (8)3.3.1.串口 (8)3.3.2.继电器 (8)3.3.3.网络接口 (8)B接口 (8)4.操作 (9)4.1.显示与控制要素 (9)4.1.1.总体外观 (9)4.1.2.键盘 (9)4.1.3.主菜单 (10)4.1.4. 设备 (12)4.1.4.1. 设备设置 (13)4.1.5.设置 (15)4.1.5.1 设备 (15)4.1.5.2. 系统 (17)4.1.5.3. GSM Modem (19)4.1.6. 显示 (19)4.1.6.1.显示 (20)4.1.6.2. 界面总体外观 (21)4.1.7.导入 (23)4.1.8.导出 (24)4.1.9. 触发器/警报 (25)4.1.9.1.触发器/警报设置 (27)4.1.10.数据处理 (28)4.1.11.系统日志 (30)4.1.12. 系统重启动 (30)4.1.13.停止监测 (31)4.1.14. 备份 (32)4.1.15. 状态 (32)4.1.16. 接口设置 (33)4.1.17.测试功能 (33)5.接入新电极 (35)6.更新校准数据 (35)图表目录图表 1:TriBox2 外形尺寸(单位mm) (2)图表 2:TriBox2前/下端面板的接口和连接头 (4)图表 3: 铝质装饰板后的螺栓连接 (5)图表 4: TriBox2内部视图 (6)图表 5:配有用户相关电极、电源连接装置的TriBox2的主板 (7)图表 6: 窗口总体格式 (9)图表 7: 键盘(图形) (10)图表 8: 局部视图,进入主菜单 (10)图表 9: 主菜单 (11)图表 10: 菜单2 (12)图表 11: 例:设备清单显示在线与离线设备 (13)图表 12: 例:设备设置 (14)图表 13: 设备设置(根据所选设备不同有所差别,参照图12) (15)图表 14: 采样定时器设置 (16)图表 15: 储存设置(根据已选定的设备,选项可能与本图有所不同) (17)图表 16: 系统设置 (17)图表 17:Modem设置 (19)图表 18: 显示设置 (20)图表 19: 界面样式列表 (21)图表 20: 全屏界面 (21)图表 21: 一上一下分屏叠放的界面 (22)图表 22: 一上两下分屏叠放的界面 (22)图表 23: 两上一下分屏叠放的界面 (23)图表 24: 四屏叠放的界面 (23)图表 25: 例:导出文件的窗口 (24)图表 26: 例:导出文件时的进程 (24)图表 27:触发器/警报列表 (25)图表 28:触发器/警报设置 (25)图表 29:上限与下限数值 (28)图表 30:数据处理方法列表 (29)图表 31:线性物质分析LSA方法的设置 (29)图表 32:程序信息(日志) (30)图表 33:重启确认提示 (31)图表 34:关机确认提示 (31)图表 35:状态窗口 (32)图表 36: 接口设置 (33)图表 37:测试菜单 (34)1.安全规则1.1.操作安全本系统采用最新技术进行制作并测试。