[gecode-users] Rounding behavior of relational constraints
Vincent Barichard
Vincent.Barichard at univ-angers.fr
Wed Nov 13 09:46:12 CET 2013
Dear all,
Indeed, in propagators, for example the "Linear" propagator internal
calculations are done to update bounds of variables. If the maximum float
value is involved in these calculation it may leads to rounding result
behaviors defined in the IEEE floating rules. There is no way to avoid it
but the computes remain correct. Even if the bounds are not as tight as
expected after a call to "propagate", no solution is lost. After a
branching, the interval will be cut and most of the time the bounds
propagate as expected.
To illustrate these floating rounding behaviors, please consider the
following C++ code :
#include <iostream>
#include <limits>
using namespace std;
int main() {
float mx = std::numeric_limits<float>::max();
cout << "Max float value mx=" << mx << endl;
cout << "Addition with a small constant: mx+2=" << mx + 2 << endl;
cout << "Equality test with addition with a small constant: mx+2==mx ? =
" << (((mx + 2)==mx)?"TRUE":"FALSE") << endl;
cout << "Addition with a bigger constant: mx+mx/2=" << mx + mx/2 << endl;
cout << "Equality test with addition with a bigger constant: mx+mx/2==mx
? = " << (((mx + mx/2)==mx)?"TRUE":"FALSE") << endl;
cout << "Order of computes 1 : mx+2-mx= " << mx+2-mx << std::endl;
cout << "Order of computes 2 : mx-mx+2= " << mx-mx+2 << std::endl;
return 0;
}
gives :
Max float value mx=3.40282e+38
Addition with a small constant: mx+2=3.40282e+38
Equality test with addition with a small constant: mx+2==mx ? = TRUE
Addition with a bigger constant: mx+mx/2=inf
Equality test with addition with a bigger constant: mx+mx/2==mx ? =
FALSE
Order of computes 1 : mx+2-mx= 0
Order of computes 2 : mx-mx+2= 2
As you see, different results are computed depending of the value of the
constants and even of the order of the computes. Keep in mind that no
solution will be lost. The best advice I can give is to set initial bounds
of variables as tight as possible to make propagation as efficient as it
can be.
Regards,
Vincent Barichard
2013/11/12 Joost van Twist <joost.van.twist at quintiq.com>
> Dear all,
>
> When using a relational constraint between two or more floating variables
> the bounds might not be always updated as you would expect during
> propagation. This happens only when being close to the maximum limits of
> floats. Why does this happen?
>
> I have attached an example program. It has two variables and adds a
> constraint stating that the second variable should be bigger than the first
> plus some small constant. The lower bound of the second variable remains
> zero however under some conditions.
>
> First I thought is was some kind of bug, but after posting a report, it
> appeared to be because of some rounding side effects and it is not an issue
> when the bounds shrink. Christian suggested to repost it as question. I
> have also attached the initial answer Vincent gave who worked on the
> floating module.
>
> Kind regards,
>
>
>
>
>
>
>
>
>
>
>
> [image: Quintiq logo] <http://www.quintiq.com/> Joost van Twist Software
> Engineer R&D Optimization Team *Quintiq* T +31 73 691 0739 M +31 63 179
> 1690 E joost.van.twist at quintiq.com www.quintiq.com [image: Twitter]<http://twitter.com/quintiq> [image:
> Facebook] <http://www.facebook.com/Quintiq> [image: LinkedIn]<http://www.linkedin.com/company/quintiq> [image:
> YouTube] <http://www.youtube.com/channelquintiq> Please consider the
> environment before printing this email.
>
>
> ---------- Message transféré ----------
> From: "Vincent Barichard" <Vincent.Barichard at univ-angers.fr>
> To: cschulte at kth.se
> Cc:
> Date: 10 Nov 2013 22:17:11 +0100
> Subject: Re: FW: [Gecode-bugs] New bug: Relational constraint gives
> inconsistent lowerbound for floating variables
> Hi Christian,
>
> I looked quickly (I'm not at home for now) and I think that the bug is in
> the compute
> of the sl and sly variables (see propagate of Lq<P,N> of linear/nary.hpp).
> Indeed, the upper bound is set to FLOAT_MAX, and as a consequence some
> compute failed.
> When sl is computed (lines 353 and 356) we get : FLOAT_MAX + -2 =
> FLOAT_MAX,
> When sly is computed (line 374) we get : FLOAT_MAX - sl =
> 6.9533558075717661e-310 (almost 0)
>
> The order of the computes has an effect on the result. I put here after an
> example
> taken from gdb :
> (gdb) p y[i].max() + 2 - y[i].max()
> $30 = 0
> (gdb) p y[i].max() - y[i].max() + 2
> $31 = 2
>
> In an ideal world we would get sly = FLOAT_MAX - FLOAT_MAX + 2 = 2
> It will work after a cut (during search) but a call to status() is not
> enough to get
> some reductions.
>
> I don't know an easy fix. The only way I see is to identify the FLOAT_MAX
> cases each time it is encountered and to make some special cases. You may
> have another idea ?
>
> Just a thought. I ever encountered these cases in the past, calculations
> are not wrong, and most of the time, tighter bounds of the variables when
> modeling solves the problem. It may occur in many propagators each time a
> compute involves FLOAT_MAX.
>
> Cheers,
> Vincent
>
>
> 2013/11/10 Christian Schulte <cschulte at kth.se>
>
>> Hi Vincent,
>>
>> Any idea?
>>
>> Cheers
>> Christian
>>
>> --
>> Christian Schulte, www.ict.kth.se/~cschulte/
>>
>> > -----Original Message-----
>> > From: bugs-bounces at gecode.org [mailto:bugs-bounces at gecode.org] On
>> > Behalf Of Gecode Bug Tracker
>> > Sent: Saturday, November 09, 2013 5:03 PM
>> > To: bugs at gecode.org; joost.van.twist at quintiq.com
>> > Subject: [Gecode-bugs] New bug: Relational constraint gives inconsistent
>> > lowerbound for floating variables
>> >
>> > New bug report for Gecode from Joost van Twist
>> (joost.van.twist at quintiq.com).
>> >
>> > Summary: Relational constraint gives inconsistent lowerbound for
>> floating
>> > variables
>> >
>> > Gecode version: 4.2.0
>> > Platform: Windows
>> >
>> > Details:
>> > /*
>> > The following program posts a simple relation between two float
>> variables.
>> The
>> > lowerbound of variable b remains zero while it should become 2. It does
>> become
>> > 2 when changing the upperbound of b to a smaller value (1000 for
>> example).
>> > Also when using the \">\" operator the lowerbound of b will be 2 as
>> well.
>> > */
>> >
>> > #include \"gecode/float.hh\"
>> > #include \"gecode/minimodel.hh\"
>> >
>> > using namespace Gecode;
>> >
>> > class TestModel : public Gecode::Space
>> > {
>> > public:
>> > FloatVar a;
>> > FloatVar b;
>> >
>> > TestModel()
>> > : a(*this,0, 0),
>> > b(*this,0, Gecode::Float::Limits::max) //using an upper bound
>> significantly
>> > smaller is also a workaround
>> > {
>> > rel(*this, b >= a + 2.0); //lower bound of b will stay 0, when
>> changing to \">\"
>> > works fine
>> > //rel(*this, b == 0); //will still make the space correctly
>> infeasible
>> > }
>> >
>> > TestModel(bool share, TestModel& testmodel)
>> > : Space(share, testmodel)
>> > {
>> > a.update(*this, share, testmodel.a);
>> > b.update(*this, share, testmodel.b);
>> > }
>> >
>> > virtual Gecode::Space* copy(bool share)
>> > {
>> > return new TestModel(share, *this);
>> > }
>> >
>> > virtual void print(std::ostream& os) const
>> > {
>> > os << \"a: \" << a << \" b: \" << b << std::endl;
>> > }
>> > };
>> >
>> >
>> > int main(int argc, char* argv[])
>> > {
>> > TestModel model;
>> >
>> > if ( model.status() == SS_FAILED )
>> > {
>> > std::cout << \"infeasible\" << std::endl;
>> > } else
>> > {
>> > std::cout << \"feasible\" << std::endl;
>> > }
>> >
>> > model.print(std::cout);
>> >
>> > return 0;
>> > }
>> >
>> > _______________________________________________
>> > bugs mailing list
>> > bugs at gecode.org
>> > http://www.gecode.org/cgi-bin/mailman/listinfo/bugs
>>
>>
>
>
> --
> Vincent Barichard Université d'Angers (LERIA)
> Tel: 02 41 73 52 06 Département Informatique
> Fax: 02 41 73 50 73 H203
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
>
--
Vincent Barichard Université d'Angers (LERIA)
Tel: 02 41 73 52 06 Département Informatique
Fax: 02 41 73 50 73 H203
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20131113/51e61d4a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 285 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20131113/51e61d4a/attachment-0006.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 233 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20131113/51e61d4a/attachment-0007.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 2801 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20131113/51e61d4a/attachment-0008.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 255 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20131113/51e61d4a/attachment-0009.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 692 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20131113/51e61d4a/attachment-0010.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 396 bytes
Desc: not available
URL: <http://www.gecode.org/pipermail/users/attachments/20131113/51e61d4a/attachment-0011.gif>
More information about the users
mailing list


The video focuses on how to map waterways and residential area. I also discuss the issue of digitization coverage for the scope of project
Controls classroom workflow by dividing large areas into small, easy to map tasks.
The reference list of features on OpenStreetMap. Use this when you want to know how to tag a map feature.
HOT is an organization dedicated to using OpenStreetMap to assist in various humanitarian purposes such as social & economic development and disaster response.
HOT operates their own tasking manager for mission-driven mapping projects.
HOT produced several 2-minute how-to videos for basic mapping technique
MapRoulette is a fun & engaging way to fix mapping errors one step at a time. Particularly fun challenge for students!
MapGive is an initiative of the US Department of State/Humanitarian Information Unit and is aimed at recruiting new mappers to add features in poorly mapped areas
OSMCha is short for, "OSM Changeset Analyzer". It is a flexible, powerful, and easy-to-use tool for quality control. Use it to examine your students' mapping progress.
Overpass-Turbo is an application used for quality control as well as to extract small amounts of data from OSM. For documentation, see the OSM wiki (https://wiki.openstreetmap.org)
A collection of useful tools for interrogating OpenStreetMap. Important links here include 'How did you Contribute' and 'Your OSM Heatmap'
description coming soon


Technoliterati-The Literary Society
Technoliterati is the literary society of IGDTUW. It envisions the amalgamation of creativity and technology. It aims to break the monotony of an engineering student’s life and provide some new food for thought. This it does by encouraging students to actively take part in the various events organized by the society and writing for the college magazine Mindscapes.
The Economics society
The Economics Society, a virtual forum to make students more comfortable with topics such as stock market, share market, bonds and debentures, was started by Shailaja Gupta, from the batch of 2009-13, ECE Department.
Taarangana - The Cultural Society


Index of all elements
[ e ] [ f ] [ i
] [ m ] [ o ] [ s
] [ t ]
e
- $error
- in file tooltips, variable tooltips::$error
In case of an error read this property's
value to find out what went wrong
top
f
- $fadeInDelay
- in file tooltips, variable tooltips::$fadeInDelay
How long (in milliseconds) should the
script wait onmousemove/onmouseover, before starting to fade in a
tooltip
- $fadeInSpeed
- in file tooltips, variable tooltips::$fadeInSpeed
The speed with which a tooltip should fade
in.
- $fadeOutDelay
- in file tooltips, variable tooltips::$fadeOutDelay
How long (in milliseconds) should the
script wait onmouseout, before starting to fade out a tooltip
- $fadeOutSpeed
- in file tooltips, variable tooltips::$fadeOutSpeed
The speed with which a tooltip should fade
out.
top
top
m
- $maximumOpacity
- in file tooltips, variable tooltips::$maximumOpacity
A percentual value representing the maximum
opacity a tooltip can get
top
o
- $offsetX
- in file tooltips, variable tooltips::$offsetX
How far (in pixels), horizontally, should
the tooltip's top-left corner be positioned relatively to the mouse
cursor
- $offsetY
- in file tooltips, variable tooltips::$offsetY
How far (in pixels), vertically, should the
tooltip's top-left corner be positioned relatively to the mouse
cursor
top
s
- show
- in file tooltips, method tooltips::show()
Returns the JavaScript code that will make
a tooltip show.
top
t
- $template
- in file tooltips, variable tooltips::$template
Template folder to use Note that only the
folder of the template you wish to use needs to be specified.
Inside the folder you must have the template.xtpl
file which will be automatically used
- tooltips
- procedural page tooltips
- tooltips
- in file tooltips, class tooltips
A class used to generate JavaScript
tooltips.
top
|
|


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/Cheap.20installation.20idea.20for.20Windows.html ---
If I download Lean 3.4.1 and a recent mathlib on a Windows 7 machine, write a careful leanpkg.path, compile everything (i.e. make all the .olean
files), bundle it all up and make it accessible to a bunch of undergraduates who are also using Windows 7 machines, is it likely that they would be able to download and extract this bundle of files and then just have a working Lean and mathlib? In other words, are .olean
files compiled on one machine likely to work on another machine running the same OS?
I think you should try it and find out
I'm not aware of too much experimentation in this area
We really need such a thing to be possible
I might well do this today.
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Amzi! has a number of directives that specify operators, properties of Prolog predicates, goals to be executed and the organization of predicates into modules. The module directives are described in Modules. The rest of the directives are described here:
Sometimes it is desireable to have some predicates in an application be static (compiled) and others dynamic (interpreted). The dynamic directives, dynamic, sorted, indexed, let you tell the compiler which clauses are to remain dynamic in the logicbase, so they can be manipulated dynamically by the application.
It's syntax is:
:- multifile f1/a1, f2/a2, ... fn/an.You can have multiple multifile directives if you prefer.
The discontiguous directive is needed when the clauses of a static (compiled) predicate cannot be compiled as a single unit. This happens when the clause definitions are:
So, if the clauses are discontiguous, or there are a very large number of clauses for a predicate, that predicate needs to be declared as discontiguous.
It's syntax is:
:- discontiguous f1/a1, f2/a2, ... fn/an.
You can have multiple discontiguous directives if you prefer.
Large numbers of clauses (1000s) usually only occur for data/facts, and those clauses might better be handled dynamically, maybe as indexed or sorted if performance is an issue.
The include directive consults a Prolog source file (.pro) at the point where the include is specified. In the interpreter it is consulted. In the compiler, it is read in and compiled.
:- include('myops.pro').
The ensure_loaded directive makes sure that the mentioned file is loaded. In a consulted file, it acts just like a latent expression to load the named .plm file. In compiled code, whether in a .plm or .xpl, it waits until the end of a load, and then checks to see if the named file has been loaded. If not, it loads it.
It is particularly useful for library modules, ensuring that they are there whether the program is being tested in the interpreter or run as a compiled program.
:- ensure_loaded(list).
Typically, you will need an import directive as well, such as:
:- import(list).
for the example above. See modules for details.
Prolog operators are defined with the op/3 directive. This is described fully under Prolog Terms. The op/3 directive establishes operator definitions for the program. It is both a compiler directive and a latent expression, so its result is used both during compilation and running.
Allows the setting of Prolog flags. It is both a compiler directive and a latent expression, so its result is used both during compilation and running. The example sets the default behavior for processing decimal numbers for both the compiler and the runtime.
:- set_prolog_flag(decimals, real).
A latent expression is a term which again represents a goal. However latent expressions are executed as the file is loaded. A latent expression is indicated using the prefix :-. The compiler translates :- body. to the special goal latent_exp :- body. The Prolog loader knows that as it encounters latent_exp :- .. clauses they are to be executed and not added to the logicbase.
For example consider:
:- write('Starting loading the file\n'). a :- b. :- write('Half way through\n'). b :- c. :- write('All done').This file is compiled. When it is loaded (either as part of an application or as a single Prolog Object file) it will print out three lines at the terminal:
Starting loading the file Half way through All done
while loading the two clauses. Then the listener will be entered.
Because latent expressions are run as they are encountered, if they refer to any predicates that are NOT built-in predicates, then those predicates must be defined before the latent expression is executed.
In this example, the greeting message will be displayed as the last action when the file is consulted or loaded. If the the latent-expression was put first in the file, it would fail, because greeting/0 would not be defined.go :- write(`program running`), nl. greeting :- write(`Type go to start the program`), nl. :- greeting.
Two goals are both treated as compiler directives and as latent expressions. These are op/3 and set_prolog_flag/2. Both of these are executed by the compiler and the results used in compilation, as well as being included as latent expressions to be executed at runtime as well.
Copyright ©1987-2011 Amzi! inc. All Rights Reserved. Amzi! is a registered trademark and Logic Server is a trademark of Amzi! inc.


Situated just to the east of Tresco, separated by New Grimsby Sound, Bryher is the smallest community in the Scillies.
Position 49° 57'52"N, 006° 21'15"W (N. Entrance to New Grimsby Sound)
There are no berths for yachts at the fish quay.
New Grimsby Sound Anchor between Hangman Island and the quay. Good shelter except in NW winds.
There are 22 visitors' buoys here.
Close to the quay, there is a public toilet and a water tap by the shed.
There is a pub and cafe/restaurant on the island.
NOTE There is no garbage disposal on this island, but there is on Tresco.
Last updated February 2016.


Joe's Dana 20 PTO adapter is off a late 60s or early 70s Jeep pickup
with a Dana 20. He guesses that a shorter version might have been
available for CJs because this version puts the PTO shaft very close
to the frame rail and it apears that the shaft will hit the cross
member.
The astute may notice that Joe's pictures depicting the the Dana
20 PTO adapter mounted to the transfer case actually show the adapter
bolted to a Scout Dana 300. The adapter will NOT work on a Dana 300.
The gear will not mesh poperly and the casting of the case interfers
with the operation. Joe bolted the adapter on the Dana 300 to
illustrate how it attaches.
Matt O'Brien sent some pictures from
his CJ-p5 that show his adapter bolted to a Dana 20.
|
|
Front the front you can see the drive shaft going off to the PTO winch.
|
|
|
From the passenger side, the lever to engage the PTO is visible. Matt
doesn't have all the linkage hooked up, so he enjoys crawling under his
Jeep in deep water and mud to pull that lever.
|
|
|
From the rear you can see the lever to engage the PTO and the rear
PTO output of the adapter. You can also see the ground clearance
lost by the Dana 20 PTO adapter, it isn't nearly as bad as one would
think it would be. The Dana 20 already has a deep oil pan and the bulk
of the adapter is toward the high side of the transfer case.
|
|
|
From the drivers side you can see the front and rear PTO outputs for the
PTO adapter and the PTO shaft going up front.
|
|
|
Identification Information
Some identification information off of the PTO
adapters:
|
Matt's
|
|
Transfer case adaptor
|
Ramsey Winch / STC-2 / 73001
|
|
Chain drive cover
|
STC-5W / 73080
|
|
|
Joe's
|
|
Transfer case adaptor
|
Ramsey Winch / STC-2 / 73001
|
|
Chain drive housing
|
STC-3 / 73002
|
|
Contributors
Thanks to Matt O'Brien
and Jeepin Joe Heinrich for the Dana 20 PTO adapter pictures and
information.


Comments are lines of code that JavaScript will intentionally ignore. Comments are a great way to leave notes to yourself and to other people who will later need to figure out what that code does.
There are two ways to write comments in JavaScript:
Using //
will tell JavaScript to ignore the remainder of the text on the current line:
// This is an in-line comment.
You can make a multi-line comment beginning with /*
and ending with */
:
/* This is a multi-line comment */
As you write code, you should regularly add comments to clarify the function of parts of your code. Good commenting can help communicate the intent of your code - both for others and for your future self.


Signing up is quick and easy. We just need:
First Name:
Last Name:
Email Address:
Favorite Planet:
Please choose
Earth
Jupitor
Saturn
Pluto
Check this box to confirm that you are not a robot
Didn't find what you were looking for? Click the links below and discover more
Home
Contact Page
Learn More: Email Club


or
Upload your comma-separated questions above. Each question goes on a separate line.
To reveal an answer click on the dark-blue question area (like you just did) or click this answer section.
Fun fact: This application uses the Leitner System. Enjoy!


India vs Oman Football Live Streaming, FIFA World Cup 2022 Qualifiers: When and where to watch IND vs OMA
India vs Oman Football Match Live Score Streaming, FIFA World Cup 2022 Qualifiers Live Score Streaming: India take on Oman in a do-or-die FIFA World Cup qualifying match.
by Sports DeskIndia vs Oman Football Live Score, FIFA World Cup 2022 Qualifiers Live Streaming: Winless in four games so far, the Indian football team faces higher-ranked Oman in a do-or-die World Cup qualifying round match on Tuesday. A first half strike from Sunil Chhetri gave India hopes of beating Oman in the first leg in Guwahati in September but the men in blue went down in the final 10 minutes. Oman are coming into this match after an emphatic (4-1) win over Bangladesh on November 14. India, on the other hand, are struggling after an impressive goal-less draw against Asian champions Qatar as they needed late equalisers in their identical 1-1 draws against lower-ranked Bangladesh and Afghanistan.
When is the World Cup qualifying match between India vs Oman?
The World Cup qualifying match between India vs Oman is on Tuesday, November 19, 2019.
Where is the World Cup qualifying match between India vs Oman being played?
The World Cup qualifying match between India vs Oman will be played at the Central Republican Stadium, Dushanbe.
What time does the World Cup qualifying match between India vs Oman begin?
The World Cup qualifying match between India vs Oman will begin at 08:30 PM IST.
Which TV channel will broadcast the World Cup qualifying match between India vs Oman?
The World Cup qualifying match between India vs Oman will broadcast on Star Sports 1 & 1HD, Star Sports 2 and 2HD, Star Sports Hindi and Hindi HD.
Where can the World Cup qualifying match between India vs Oman be live-streamed?
The World Cup qualifying match between India vs Oman can be live-streamed on Hotstar.


Install Basic AWS With Terraform
Install AWS CLI V2 With Windows (64-bit)
Download file from AWS CLI V2 Make sure to follow instruction to C:\Program Files\Amazon\AWSCLIV2. confirm installation press start and search cmd
Install AWS CLI With MacOS
If you have Homebrew type:
If not install Homebrew type:
Now you need to configure to able access your AWS account
type:
Install Terraform
For Windows download MacOs type:
Crete new folder for Terraform and than file
Open Visual Studio Code, Atom or your preferred IDE
Basic example to lunch instance with terraform
_ Resource can be found on your aws lunch es2 instance
Than we need to initialize terraform
save name.tf and apply:


--- layout: post title: ! 'mafutago reaches beta ' published: true date: 2011-12-26 01:23:00 tags: [mafutago,apps] ---
mafutago has reached the beta phase .... with a new look for the website and an andriod app coming out soon try it here


Context Alert Filters
Context Alert Filters allow you to automatically override the risk levels
of any alerts raised by the active and passive scan rules within a context.
This add-on adds an 'Alert filters' panel to the contexts dialog.
The panel shows a list of all of the Alert filters along with buttons for
adding, removing and deleting them.
The 'add' and 'modify' dialogs have the following fields:
Alert
A pull down containing all of the active and passive alert rules currently installed.
New Level
The new level to be assigned to any alerts raised that match the criteria defined by the rule.
URL
An optional URL.
If specified then this rule will be applied if the URL matches the URL of a raised alert.
URL is regex
If set and a URL is specified then the URL will be treated as a regex expression when compared with the URL of the alert.
If it is not set then any specified URL must exactly match the URL of the alert.
Parameter
An optional parameter.
If specified then this rule will be applied if the parameter exactly matches the parameter of a raised alert.
Enabled
If set then this rule will be applied to all alerts raise against the given context.


/** * @author Richard Davey<EMAIL_ADDRESS>* @copyright 2015 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ /** * The Arcade Physics world. Contains Arcade Physics related collision, overlap and motion methods. * * @class Phaser.Physics.Arcade * @constructor * @param {Phaser.Game} game - reference to the current game instance. */ Phaser.Physics.Arcade = function (game) { /** * @property {Phaser.Game} game - Local reference to game. */ this.game = game; /** * @property {Phaser.Point} gravity - The World gravity setting. Defaults to x: 0, y: 0, or no gravity. */ this.gravity = new Phaser.Point(); /** * @property {Phaser.Rectangle} bounds - The bounds inside of which the physics world exists. Defaults to match the world bounds. */ this.bounds = new Phaser.Rectangle(0, 0, game.world.width, game.world.height); /** * Set the checkCollision properties to control for which bounds collision is processed. * For example checkCollision.down = false means Bodies cannot collide with the World.bounds.bottom. * @property {object} checkCollision - An object containing allowed collision flags. */ this.checkCollision = { up: true, down: true, left: true, right: true }; /** * @property {number} maxObjects - Used by the QuadTree to set the maximum number of objects per quad. */ this.maxObjects = 10; /** * @property {number} maxLevels - Used by the QuadTree to set the maximum number of iteration levels. */ this.maxLevels = 4; /** * @property {number} OVERLAP_BIAS - A value added to the delta values during collision checks. */ this.OVERLAP_BIAS = 4; /** * @property {boolean} forceX - If true World.separate will always separate on the X axis before Y. Otherwise it will check gravity totals first. */ this.forceX = false; /** * @property {number} sortDirection - Used when colliding a Sprite vs. a Group, or a Group vs. a Group, this defines the direction the sort is based on. Default is Phaser.Physics.Arcade.LEFT_RIGHT. * @default */ this.sortDirection = Phaser.Physics.Arcade.LEFT_RIGHT; /** * @property {boolean} skipQuadTree - If true the QuadTree will not be used for any collision. QuadTrees are great if objects are well spread out in your game, otherwise they are a performance hit. If you enable this you can disable on a per body basis via `Body.skipQuadTree`. */ this.skipQuadTree = true; /** * @property {boolean} isPaused - If `true` the `Body.preUpdate` method will be skipped, halting all motion for all bodies. Note that other methods such as `collide` will still work, so be careful not to call them on paused bodies. */ this.isPaused = false; /** * @property {Phaser.QuadTree} quadTree - The world QuadTree. */ this.quadTree = new Phaser.QuadTree(this.game.world.bounds.x, this.game.world.bounds.y, this.game.world.bounds.width, this.game.world.bounds.height, this.maxObjects, this.maxLevels); /** * @property {number} _total - Internal cache var. * @private */ this._total = 0; // By default we want the bounds the same size as the world bounds this.setBoundsToWorld(); }; Phaser.Physics.Arcade.prototype.constructor = Phaser.Physics.Arcade; /** * A constant used for the sortDirection value. * Use this if you don't wish to perform any pre-collision sorting at all, or will manually sort your Groups. * @constant * @type {number} */ Phaser.Physics.Arcade.SORT_NONE = 0; /** * A constant used for the sortDirection value. * Use this if your game world is wide but short and scrolls from the left to the right (i.e. Mario) * @constant * @type {number} */ Phaser.Physics.Arcade.LEFT_RIGHT = 1; /** * A constant used for the sortDirection value. * Use this if your game world is wide but short and scrolls from the right to the left (i.e. Mario backwards) * @constant * @type {number} */ Phaser.Physics.Arcade.RIGHT_LEFT = 2; /** * A constant used for the sortDirection value. * Use this if your game world is narrow but tall and scrolls from the top to the bottom (i.e. Dig Dug) * @constant * @type {number} */ Phaser.Physics.Arcade.TOP_BOTTOM = 3; /** * A constant used for the sortDirection value. * Use this if your game world is narrow but tall and scrolls from the bottom to the top (i.e. Commando or a vertically scrolling shoot-em-up) * @constant * @type {number} */ Phaser.Physics.Arcade.BOTTOM_TOP = 4; Phaser.Physics.Arcade.prototype = { /** * Updates the size of this physics world. * * @method Phaser.Physics.Arcade#setBounds * @param {number} x - Top left most corner of the world. * @param {number} y - Top left most corner of the world. * @param {number} width - New width of the world. Can never be smaller than the Game.width. * @param {number} height - New height of the world. Can never be smaller than the Game.height. */ setBounds: function (x, y, width, height) { this.bounds.setTo(x, y, width, height); }, /** * Updates the size of this physics world to match the size of the game world. * * @method Phaser.Physics.Arcade#setBoundsToWorld */ setBoundsToWorld: function () { this.bounds.copyFrom(this.game.world.bounds); }, /** * This will create an Arcade Physics body on the given game object or array of game objects. * A game object can only have 1 physics body active at any one time, and it can't be changed until the object is destroyed. * * @method Phaser.Physics.Arcade#enable * @param {object|array|Phaser.Group} object - The game object to create the physics body on. Can also be an array or Group of objects, a body will be created on every child that has a `body` property. * @param {boolean} [children=true] - Should a body be created on all children of this object? If true it will recurse down the display list as far as it can go. */ enable: function (object, children) { if (children === undefined) { children = true; } var i = 1; if (Array.isArray(object)) { i = object.length; while (i--) { if (object[i] instanceof Phaser.Group) { // If it's a Group then we do it on the children regardless this.enable(object[i].children, children); } else { this.enableBody(object[i]); if (children && object[i].hasOwnProperty('children') && object[i].children.length > 0) { this.enable(object[i], true); } } } } else { if (object instanceof Phaser.Group) { // If it's a Group then we do it on the children regardless this.enable(object.children, children); } else { this.enableBody(object); if (children && object.hasOwnProperty('children') && object.children.length > 0) { this.enable(object.children, true); } } } }, /** * Creates an Arcade Physics body on the given game object. * * A game object can only have 1 physics body active at any one time, and it can't be changed until the body is nulled. * * When you add an Arcade Physics body to an object it will automatically add the object into its parent Groups hash array. * * @method Phaser.Physics.Arcade#enableBody * @param {object} object - The game object to create the physics body on. A body will only be created if this object has a null `body` property. */ enableBody: function (object) { if (object.hasOwnProperty('body') && object.body === null) { object.body = new Phaser.Physics.Arcade.Body(object); if (object.parent && object.parent instanceof Phaser.Group) { object.parent.addToHash(object); } } }, /** * Called automatically by a Physics body, it updates all motion related values on the Body unless `World.isPaused` is `true`. * * @method Phaser.Physics.Arcade#updateMotion * @param {Phaser.Physics.Arcade.Body} The Body object to be updated. */ updateMotion: function (body) { var velocityDelta = this.computeVelocity(0, body, body.angularVelocity, body.angularAcceleration, body.angularDrag, body.maxAngular) - body.angularVelocity; body.angularVelocity += velocityDelta; body.rotation += (body.angularVelocity * this.game.time.physicsElapsed); body.velocity.x = this.computeVelocity(1, body, body.velocity.x, body.acceleration.x, body.drag.x, body.maxVelocity.x); body.velocity.y = this.computeVelocity(2, body, body.velocity.y, body.acceleration.y, body.drag.y, body.maxVelocity.y); }, /** * A tween-like function that takes a starting velocity and some other factors and returns an altered velocity. * Based on a function in Flixel by @ADAMATOMIC * * @method Phaser.Physics.Arcade#computeVelocity * @param {number} axis - 0 for nothing, 1 for horizontal, 2 for vertical. * @param {Phaser.Physics.Arcade.Body} body - The Body object to be updated. * @param {number} velocity - Any component of velocity (e.g. 20). * @param {number} acceleration - Rate at which the velocity is changing. * @param {number} drag - Really kind of a deceleration, this is how much the velocity changes if Acceleration is not set. * @param {number} [max=10000] - An absolute value cap for the velocity. * @return {number} The altered Velocity value. */ computeVelocity: function (axis, body, velocity, acceleration, drag, max) { if (max === undefined) { max = 10000; } if (axis === 1 && body.allowGravity) { velocity += (this.gravity.x + body.gravity.x) * this.game.time.physicsElapsed; } else if (axis === 2 && body.allowGravity) { velocity += (this.gravity.y + body.gravity.y) * this.game.time.physicsElapsed; } if (acceleration) { velocity += acceleration * this.game.time.physicsElapsed; } else if (drag) { drag *= this.game.time.physicsElapsed; if (velocity - drag > 0) { velocity -= drag; } else if (velocity + drag < 0) { velocity += drag; } else { velocity = 0; } } if (velocity > max) { velocity = max; } else if (velocity < -max) { velocity = -max; } return velocity; }, /** * Checks for overlaps between two game objects. The objects can be Sprites, Groups or Emitters. * You can perform Sprite vs. Sprite, Sprite vs. Group and Group vs. Group overlap checks. * Unlike collide the objects are NOT automatically separated or have any physics applied, they merely test for overlap results. * Both the first and second parameter can be arrays of objects, of differing types. * If two arrays are passed, the contents of the first parameter will be tested against all contents of the 2nd parameter. * NOTE: This function is not recursive, and will not test against children of objects passed (i.e. Groups within Groups). * * @method Phaser.Physics.Arcade#overlap * @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|array} object1 - The first object or array of objects to check. Can be Phaser.Sprite, Phaser.Group or Phaser.Particles.Emitter. * @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|array} object2 - The second object or array of objects to check. Can be Phaser.Sprite, Phaser.Group or Phaser.Particles.Emitter. * @param {function} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them, unless you are checking Group vs. Sprite, in which case Sprite will always be the first parameter. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then `overlapCallback` will only be called if this callback returns `true`. * @param {object} [callbackContext] - The context in which to run the callbacks. * @return {boolean} True if an overlap occurred otherwise false. */ overlap: function (object1, object2, overlapCallback, processCallback, callbackContext) { overlapCallback = overlapCallback || null; processCallback = processCallback || null; callbackContext = callbackContext || overlapCallback; this._total = 0; if (!Array.isArray(object1) && Array.isArray(object2)) { for (var i = 0; i < object2.length; i++) { this.collideHandler(object1, object2[i], overlapCallback, processCallback, callbackContext, true); } } else if (Array.isArray(object1) && !Array.isArray(object2)) { for (var i = 0; i < object1.length; i++) { this.collideHandler(object1[i], object2, overlapCallback, processCallback, callbackContext, true); } } else if (Array.isArray(object1) && Array.isArray(object2)) { for (var i = 0; i < object1.length; i++) { for (var j = 0; j < object2.length; j++) { this.collideHandler(object1[i], object2[j], overlapCallback, processCallback, callbackContext, true); } } } else { this.collideHandler(object1, object2, overlapCallback, processCallback, callbackContext, true); } return (this._total > 0); }, /** * Checks for collision between two game objects. You can perform Sprite vs. Sprite, Sprite vs. Group, Group vs. Group, Sprite vs. Tilemap Layer or Group vs. Tilemap Layer collisions. * Both the first and second parameter can be arrays of objects, of differing types. * If two arrays are passed, the contents of the first parameter will be tested against all contents of the 2nd parameter. * The objects are also automatically separated. If you don't require separation then use ArcadePhysics.overlap instead. * An optional processCallback can be provided. If given this function will be called when two sprites are found to be colliding. It is called before any separation takes place, * giving you the chance to perform additional checks. If the function returns true then the collision and separation is carried out. If it returns false it is skipped. * The collideCallback is an optional function that is only called if two sprites collide. If a processCallback has been set then it needs to return true for collideCallback to be called. * NOTE: This function is not recursive, and will not test against children of objects passed (i.e. Groups or Tilemaps within other Groups). * * @method Phaser.Physics.Arcade#collide * @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|Phaser.TilemapLayer|array} object1 - The first object or array of objects to check. Can be Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter, or Phaser.TilemapLayer. * @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|Phaser.TilemapLayer|array} object2 - The second object or array of objects to check. Can be Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter or Phaser.TilemapLayer. * @param {function} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them, unless you are colliding Group vs. Sprite, in which case Sprite will always be the first parameter. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them, unless you are colliding Group vs. Sprite, in which case Sprite will always be the first parameter. * @param {object} [callbackContext] - The context in which to run the callbacks. * @return {boolean} True if a collision occurred otherwise false. */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { collideCallback = collideCallback || null; processCallback = processCallback || null; callbackContext = callbackContext || collideCallback; this._total = 0; if (!Array.isArray(object1) && Array.isArray(object2)) { for (var i = 0; i < object2.length; i++) { this.collideHandler(object1, object2[i], collideCallback, processCallback, callbackContext, false); } } else if (Array.isArray(object1) && !Array.isArray(object2)) { for (var i = 0; i < object1.length; i++) { this.collideHandler(object1[i], object2, collideCallback, processCallback, callbackContext, false); } } else if (Array.isArray(object1) && Array.isArray(object2)) { for (var i = 0; i < object1.length; i++) { for (var j = 0; j < object2.length; j++) { this.collideHandler(object1[i], object2[j], collideCallback, processCallback, callbackContext, false); } } } else { this.collideHandler(object1, object2, collideCallback, processCallback, callbackContext, false); } return (this._total > 0); }, /** * A Sort function for sorting two bodies based on a LEFT to RIGHT sort direction. * * This is called automatically by World.sort * * @method Phaser.Physics.Arcade#sortLeftRight * @param {Phaser.Sprite} a - The first Sprite to test. The Sprite must have an Arcade Physics Body. * @param {Phaser.Sprite} b - The second Sprite to test. The Sprite must have an Arcade Physics Body. * @return {integer} A negative value if `a > b`, a positive value if `a < b` or 0 if `a === b` or the bodies are invalid. */ sortLeftRight: function (a, b) { if (!a.body || !b.body) { return 0; } return a.body.x - b.body.x; }, /** * A Sort function for sorting two bodies based on a RIGHT to LEFT sort direction. * * This is called automatically by World.sort * * @method Phaser.Physics.Arcade#sortRightLeft * @param {Phaser.Sprite} a - The first Sprite to test. The Sprite must have an Arcade Physics Body. * @param {Phaser.Sprite} b - The second Sprite to test. The Sprite must have an Arcade Physics Body. * @return {integer} A negative value if `a > b`, a positive value if `a < b` or 0 if `a === b` or the bodies are invalid. */ sortRightLeft: function (a, b) { if (!a.body || !b.body) { return 0; } return b.body.x - a.body.x; }, /** * A Sort function for sorting two bodies based on a TOP to BOTTOM sort direction. * * This is called automatically by World.sort * * @method Phaser.Physics.Arcade#sortTopBottom * @param {Phaser.Sprite} a - The first Sprite to test. The Sprite must have an Arcade Physics Body. * @param {Phaser.Sprite} b - The second Sprite to test. The Sprite must have an Arcade Physics Body. * @return {integer} A negative value if `a > b`, a positive value if `a < b` or 0 if `a === b` or the bodies are invalid. */ sortTopBottom: function (a, b) { if (!a.body || !b.body) { return 0; } return a.body.y - b.body.y; }, /** * A Sort function for sorting two bodies based on a BOTTOM to TOP sort direction. * * This is called automatically by World.sort * * @method Phaser.Physics.Arcade#sortBottomTop * @param {Phaser.Sprite} a - The first Sprite to test. The Sprite must have an Arcade Physics Body. * @param {Phaser.Sprite} b - The second Sprite to test. The Sprite must have an Arcade Physics Body. * @return {integer} A negative value if `a > b`, a positive value if `a < b` or 0 if `a === b` or the bodies are invalid. */ sortBottomTop: function (a, b) { if (!a.body || !b.body) { return 0; } return b.body.y - a.body.y; }, /** * This method will sort a Groups hash array. * * If the Group has `physicsSortDirection` set it will use the sort direction defined. * * Otherwise if the sortDirection parameter is undefined, or Group.physicsSortDirection is null, it will use Phaser.Physics.Arcade.sortDirection. * * By changing Group.physicsSortDirection you can customise each Group to sort in a different order. * * @method Phaser.Physics.Arcade#sort * @param {Phaser.Group} group - The Group to sort. * @param {integer} [sortDirection] - The sort direction used to sort this Group. */ sort: function (group, sortDirection) { if (group.physicsSortDirection !== null) { sortDirection = group.physicsSortDirection; } else { if (sortDirection === undefined) { sortDirection = this.sortDirection; } } if (sortDirection === Phaser.Physics.Arcade.LEFT_RIGHT) { // Game world is say 2000x600 and you start at 0 group.hash.sort(this.sortLeftRight); } else if (sortDirection === Phaser.Physics.Arcade.RIGHT_LEFT) { // Game world is say 2000x600 and you start at 2000 group.hash.sort(this.sortRightLeft); } else if (sortDirection === Phaser.Physics.Arcade.TOP_BOTTOM) { // Game world is say 800x2000 and you start at 0 group.hash.sort(this.sortTopBottom); } else if (sortDirection === Phaser.Physics.Arcade.BOTTOM_TOP) { // Game world is say 800x2000 and you start at 2000 group.hash.sort(this.sortBottomTop); } }, /** * Internal collision handler. * * @method Phaser.Physics.Arcade#collideHandler * @private * @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|Phaser.TilemapLayer} object1 - The first object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter, or Phaser.TilemapLayer. * @param {Phaser.Sprite|Phaser.Group|Phaser.Particles.Emitter|Phaser.TilemapLayer} object2 - The second object to check. Can be an instance of Phaser.Sprite, Phaser.Group, Phaser.Particles.Emitter or Phaser.TilemapLayer. Can also be an array of objects to check. * @param {function} collideCallback - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. * @param {function} processCallback - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them. * @param {object} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Just run an overlap or a full collision. */ collideHandler: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly) { // Only collide valid objects if (object2 === undefined && object1.physicsType === Phaser.GROUP) { this.sort(object1); this.collideGroupVsSelf(object1, collideCallback, processCallback, callbackContext, overlapOnly); return; } // If neither of the objects are set or exist then bail out if (!object1 || !object2 || !object1.exists || !object2.exists) { return; } // Groups? Sort them if (this.sortDirection !== Phaser.Physics.Arcade.SORT_NONE) { if (object1.physicsType === Phaser.GROUP) { this.sort(object1); } if (object2.physicsType === Phaser.GROUP) { this.sort(object2); } } // SPRITES if (object1.physicsType === Phaser.SPRITE) { if (object2.physicsType === Phaser.SPRITE) { this.collideSpriteVsSprite(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); } else if (object2.physicsType === Phaser.GROUP) { this.collideSpriteVsGroup(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); } else if (object2.physicsType === Phaser.TILEMAPLAYER) { this.collideSpriteVsTilemapLayer(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); } } // GROUPS else if (object1.physicsType === Phaser.GROUP) { if (object2.physicsType === Phaser.SPRITE) { this.collideSpriteVsGroup(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); } else if (object2.physicsType === Phaser.GROUP) { this.collideGroupVsGroup(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); } else if (object2.physicsType === Phaser.TILEMAPLAYER) { this.collideGroupVsTilemapLayer(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); } } // TILEMAP LAYERS else if (object1.physicsType === Phaser.TILEMAPLAYER) { if (object2.physicsType === Phaser.SPRITE) { this.collideSpriteVsTilemapLayer(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); } else if (object2.physicsType === Phaser.GROUP) { this.collideGroupVsTilemapLayer(object2, object1, collideCallback, processCallback, callbackContext, overlapOnly); } } }, /** * An internal function. Use Phaser.Physics.Arcade.collide instead. * * @method Phaser.Physics.Arcade#collideSpriteVsSprite * @private * @param {Phaser.Sprite} sprite1 - The first sprite to check. * @param {Phaser.Sprite} sprite2 - The second sprite to check. * @param {function} collideCallback - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. * @param {function} processCallback - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them. * @param {object} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Just run an overlap or a full collision. * @return {boolean} True if there was a collision, otherwise false. */ collideSpriteVsSprite: function (sprite1, sprite2, collideCallback, processCallback, callbackContext, overlapOnly) { if (!sprite1.body || !sprite2.body) { return false; } if (this.separate(sprite1.body, sprite2.body, processCallback, callbackContext, overlapOnly)) { if (collideCallback) { collideCallback.call(callbackContext, sprite1, sprite2); } this._total++; } return true; }, /** * An internal function. Use Phaser.Physics.Arcade.collide instead. * * @method Phaser.Physics.Arcade#collideSpriteVsGroup * @private * @param {Phaser.Sprite} sprite - The sprite to check. * @param {Phaser.Group} group - The Group to check. * @param {function} collideCallback - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. * @param {function} processCallback - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them. * @param {object} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Just run an overlap or a full collision. */ collideSpriteVsGroup: function (sprite, group, collideCallback, processCallback, callbackContext, overlapOnly) { if (group.length === 0 || !sprite.body) { return; } var body; if (this.skipQuadTree || sprite.body.skipQuadTree) { for (var i = 0; i < group.hash.length; i++) { // Skip duff entries - we can't check a non-existent sprite or one with no body if (!group.hash[i] || !group.hash[i].exists || !group.hash[i].body) { continue; } body = group.hash[i].body; // Skip items either side of the sprite if (this.sortDirection === Phaser.Physics.Arcade.LEFT_RIGHT) { if (sprite.body.right < body.x) { break; } else if (body.right < sprite.body.x) { continue; } } else if (this.sortDirection === Phaser.Physics.Arcade.RIGHT_LEFT) { if (sprite.body.x > body.right) { break; } else if (body.x > sprite.body.right) { continue; } } else if (this.sortDirection === Phaser.Physics.Arcade.TOP_BOTTOM) { if (sprite.body.bottom < body.y) { break; } else if (body.bottom < sprite.body.y) { continue; } } else if (this.sortDirection === Phaser.Physics.Arcade.BOTTOM_TOP) { if (sprite.body.y > body.bottom) { break; } else if (body.y > sprite.body.bottom) { continue; } } this.collideSpriteVsSprite(sprite, group.hash[i], collideCallback, processCallback, callbackContext, overlapOnly); } } else { // What is the sprite colliding with in the quadtree? this.quadTree.clear(); this.quadTree.reset(this.game.world.bounds.x, this.game.world.bounds.y, this.game.world.bounds.width, this.game.world.bounds.height, this.maxObjects, this.maxLevels); this.quadTree.populate(group); var items = this.quadTree.retrieve(sprite); for (var i = 0; i < items.length; i++) { // We have our potential suspects, are they in this group? if (this.separate(sprite.body, items[i], processCallback, callbackContext, overlapOnly)) { if (collideCallback) { collideCallback.call(callbackContext, sprite, items[i].sprite); } this._total++; } } } }, /** * An internal function. Use Phaser.Physics.Arcade.collide instead. * * @method Phaser.Physics.Arcade#collideGroupVsSelf * @private * @param {Phaser.Group} group - The Group to check. * @param {function} collideCallback - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. * @param {function} processCallback - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them. * @param {object} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Just run an overlap or a full collision. * @return {boolean} True if there was a collision, otherwise false. */ collideGroupVsSelf: function (group, collideCallback, processCallback, callbackContext, overlapOnly) { if (group.length === 0) { return; } for (var i = 0; i < group.hash.length; i++) { // Skip duff entries - we can't check a non-existent sprite or one with no body if (!group.hash[i] || !group.hash[i].exists || !group.hash[i].body) { continue; } var object1 = group.hash[i]; for (var j = i + 1; j < group.hash.length; j++) { // Skip duff entries - we can't check a non-existent sprite or one with no body if (!group.hash[j] || !group.hash[j].exists || !group.hash[j].body) { continue; } var object2 = group.hash[j]; // Skip items either side of the sprite if (this.sortDirection === Phaser.Physics.Arcade.LEFT_RIGHT) { if (object1.body.right < object2.body.x) { break; } else if (object2.body.right < object1.body.x) { continue; } } else if (this.sortDirection === Phaser.Physics.Arcade.RIGHT_LEFT) { if (object1.body.x > object2.body.right) { continue; } else if (object2.body.x > object1.body.right) { break; } } else if (this.sortDirection === Phaser.Physics.Arcade.TOP_BOTTOM) { if (object1.body.bottom < object2.body.y) { continue; } else if (object2.body.bottom < object1.body.y) { break; } } else if (this.sortDirection === Phaser.Physics.Arcade.BOTTOM_TOP) { if (object1.body.y > object2.body.bottom) { continue; } else if (object2.body.y > object1.body.bottom) { break; } } this.collideSpriteVsSprite(object1, object2, collideCallback, processCallback, callbackContext, overlapOnly); } } }, /** * An internal function. Use Phaser.Physics.Arcade.collide instead. * * @method Phaser.Physics.Arcade#collideGroupVsGroup * @private * @param {Phaser.Group} group1 - The first Group to check. * @param {Phaser.Group} group2 - The second Group to check. * @param {function} collideCallback - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. * @param {function} processCallback - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them. * @param {object} callbackContext - The context in which to run the callbacks. * @param {boolean} overlapOnly - Just run an overlap or a full collision. */ collideGroupVsGroup: function (group1, group2, collideCallback, processCallback, callbackContext, overlapOnly) { if (group1.length === 0 || group2.length === 0) { return; } for (var i = 0; i < group1.children.length; i++) { if (group1.children[i].exists) { if (group1.children[i].physicsType === Phaser.GROUP) { this.collideGroupVsGroup(group1.children[i], group2, collideCallback, processCallback, callbackContext, overlapOnly); } else { this.collideSpriteVsGroup(group1.children[i], group2, collideCallback, processCallback, callbackContext, overlapOnly); } } } }, /** * The core separation function to separate two physics bodies. * * @private * @method Phaser.Physics.Arcade#separate * @param {Phaser.Physics.Arcade.Body} body1 - The first Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The second Body object to separate. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this function is set then the sprites will only be collided if it returns true. * @param {object} [callbackContext] - The context in which to run the process callback. * @param {boolean} overlapOnly - Just run an overlap or a full collision. * @return {boolean} Returns true if the bodies collided, otherwise false. */ separate: function (body1, body2, processCallback, callbackContext, overlapOnly) { if (!body1.enable || !body2.enable || !this.intersects(body1, body2)) { return false; } // They overlap. Is there a custom process callback? If it returns true then we can carry on, otherwise we should abort. if (processCallback && processCallback.call(callbackContext, body1.sprite, body2.sprite) === false) { return false; } // Do we separate on x or y first? var result = false; // If we weren't having to carry around so much legacy baggage with us, we could do this properly. But alas ... if (this.forceX || Math.abs(this.gravity.y + body1.gravity.y) < Math.abs(this.gravity.x + body1.gravity.x)) { result = (this.separateX(body1, body2, overlapOnly) || this.separateY(body1, body2, overlapOnly)); } else { result = (this.separateY(body1, body2, overlapOnly) || this.separateX(body1, body2, overlapOnly)); } if (overlapOnly) { // We already know they intersect from the check above, but by this point we know they've now had their overlapX/Y values populated return true; } else { return result; } }, /** * Check for intersection against two bodies. * * @method Phaser.Physics.Arcade#intersects * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to check. * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to check. * @return {boolean} True if they intersect, otherwise false. */ intersects: function (body1, body2) { if (body1.right <= body2.position.x) { return false; } if (body1.bottom <= body2.position.y) { return false; } if (body1.position.x >= body2.right) { return false; } if (body1.position.y >= body2.bottom) { return false; } return true; }, /** * The core separation function to separate two physics bodies on the x axis. * * @private * @method Phaser.Physics.Arcade#separateX * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. * @param {boolean} overlapOnly - If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place. * @return {boolean} Returns true if the bodies were separated, otherwise false. */ separateX: function (body1, body2, overlapOnly) { // Can't separate two immovable bodies if (body1.immovable && body2.immovable) { return false; } var overlap = 0; // Check if the hulls actually overlap if (this.intersects(body1, body2)) { var maxOverlap = body1.deltaAbsX() + body2.deltaAbsX() + this.OVERLAP_BIAS; if (body1.deltaX() === 0 && body2.deltaX() === 0) { // They overlap but neither of them are moving body1.embedded = true; body2.embedded = true; } else if (body1.deltaX() > body2.deltaX()) { // Body1 is moving right and/or Body2 is moving left overlap = body1.right - body2.x; if ((overlap > maxOverlap) || body1.checkCollision.right === false || body2.checkCollision.left === false) { overlap = 0; } else { body1.touching.none = false; body1.touching.right = true; body2.touching.none = false; body2.touching.left = true; } } else if (body1.deltaX() < body2.deltaX()) { // Body1 is moving left and/or Body2 is moving right overlap = body1.x - body2.width - body2.x; if ((-overlap > maxOverlap) || body1.checkCollision.left === false || body2.checkCollision.right === false) { overlap = 0; } else { body1.touching.none = false; body1.touching.left = true; body2.touching.none = false; body2.touching.right = true; } } // Resets the overlapX to zero if there is no overlap, or to the actual pixel value if there is body1.overlapX = overlap; body2.overlapX = overlap; // Then adjust their positions and velocities accordingly (if there was any overlap) if (overlap !== 0) { if (overlapOnly || body1.customSeparateX || body2.customSeparateX) { return true; } var v1 = body1.velocity.x; var v2 = body2.velocity.x; if (!body1.immovable && !body2.immovable) { overlap *= 0.5; body1.x = body1.x - overlap; body2.x += overlap; var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); var avg = (nv1 + nv2) * 0.5; nv1 -= avg; nv2 -= avg; body1.velocity.x = avg + nv1 * body1.bounce.x; body2.velocity.x = avg + nv2 * body2.bounce.x; } else if (!body1.immovable) { body1.x = body1.x - overlap; body1.velocity.x = v2 - v1 * body1.bounce.x; // This is special case code that handles things like vertically moving platforms you can ride if (body2.moves) { body1.y += (body2.y - body2.prev.y) * body2.friction.y; } } else if (!body2.immovable) { body2.x += overlap; body2.velocity.x = v1 - v2 * body2.bounce.x; // This is special case code that handles things like vertically moving platforms you can ride if (body1.moves) { body2.y += (body1.y - body1.prev.y) * body1.friction.y; } } return true; } } return false; }, /** * The core separation function to separate two physics bodies on the y axis. * * @private * @method Phaser.Physics.Arcade#separateY * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. * @param {boolean} overlapOnly - If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place. * @return {boolean} Returns true if the bodies were separated, otherwise false. */ separateY: function (body1, body2, overlapOnly) { // Can't separate two immovable or non-existing bodies if (body1.immovable && body2.immovable) { return false; } var overlap = 0; // Check if the hulls actually overlap if (this.intersects(body1, body2)) { var maxOverlap = body1.deltaAbsY() + body2.deltaAbsY() + this.OVERLAP_BIAS; if (body1.deltaY() === 0 && body2.deltaY() === 0) { // They overlap but neither of them are moving body1.embedded = true; body2.embedded = true; } else if (body1.deltaY() > body2.deltaY()) { // Body1 is moving down and/or Body2 is moving up overlap = body1.bottom - body2.y; if ((overlap > maxOverlap) || body1.checkCollision.down === false || body2.checkCollision.up === false) { overlap = 0; } else { body1.touching.none = false; body1.touching.down = true; body2.touching.none = false; body2.touching.up = true; } } else if (body1.deltaY() < body2.deltaY()) { // Body1 is moving up and/or Body2 is moving down overlap = body1.y - body2.bottom; if ((-overlap > maxOverlap) || body1.checkCollision.up === false || body2.checkCollision.down === false) { overlap = 0; } else { body1.touching.none = false; body1.touching.up = true; body2.touching.none = false; body2.touching.down = true; } } // Resets the overlapY to zero if there is no overlap, or to the actual pixel value if there is body1.overlapY = overlap; body2.overlapY = overlap; // Then adjust their positions and velocities accordingly (if there was any overlap) if (overlap !== 0) { if (overlapOnly || body1.customSeparateY || body2.customSeparateY) { return true; } var v1 = body1.velocity.y; var v2 = body2.velocity.y; if (!body1.immovable && !body2.immovable) { overlap *= 0.5; body1.y = body1.y - overlap; body2.y += overlap; var nv1 = Math.sqrt((v2 * v2 * body2.mass) / body1.mass) * ((v2 > 0) ? 1 : -1); var nv2 = Math.sqrt((v1 * v1 * body1.mass) / body2.mass) * ((v1 > 0) ? 1 : -1); var avg = (nv1 + nv2) * 0.5; nv1 -= avg; nv2 -= avg; body1.velocity.y = avg + nv1 * body1.bounce.y; body2.velocity.y = avg + nv2 * body2.bounce.y; } else if (!body1.immovable) { body1.y = body1.y - overlap; body1.velocity.y = v2 - v1 * body1.bounce.y; // This is special case code that handles things like horizontal moving platforms you can ride if (body2.moves) { body1.x += (body2.x - body2.prev.x) * body2.friction.x; } } else if (!body2.immovable) { body2.y += overlap; body2.velocity.y = v1 - v2 * body2.bounce.y; // This is special case code that handles things like horizontal moving platforms you can ride if (body1.moves) { body2.x += (body1.x - body1.prev.x) * body1.friction.x; } } return true; } } return false; }, /** * Given a Group and a Pointer this will check to see which Group children overlap with the Pointer coordinates. * Each child will be sent to the given callback for further processing. * Note that the children are not checked for depth order, but simply if they overlap the Pointer or not. * * @method Phaser.Physics.Arcade#getObjectsUnderPointer * @param {Phaser.Pointer} pointer - The Pointer to check. * @param {Phaser.Group} group - The Group to check. * @param {function} [callback] - A callback function that is called if the object overlaps with the Pointer. The callback will be sent two parameters: the Pointer and the Object that overlapped with it. * @param {object} [callbackContext] - The context in which to run the callback. * @return {PIXI.DisplayObject[]} An array of the Sprites from the Group that overlapped the Pointer coordinates. */ getObjectsUnderPointer: function (pointer, group, callback, callbackContext) { if (group.length === 0 || !pointer.exists) { return; } return this.getObjectsAtLocation(pointer.x, pointer.y, group, callback, callbackContext, pointer); }, /** * Given a Group and a location this will check to see which Group children overlap with the coordinates. * Each child will be sent to the given callback for further processing. * Note that the children are not checked for depth order, but simply if they overlap the coordinate or not. * * @method Phaser.Physics.Arcade#getObjectsAtLocation * @param {number} x - The x coordinate to check. * @param {number} y - The y coordinate to check. * @param {Phaser.Group} group - The Group to check. * @param {function} [callback] - A callback function that is called if the object overlaps the coordinates. The callback will be sent two parameters: the callbackArg and the Object that overlapped the location. * @param {object} [callbackContext] - The context in which to run the callback. * @param {object} [callbackArg] - An argument to pass to the callback. * @return {PIXI.DisplayObject[]} An array of the Sprites from the Group that overlapped the coordinates. */ getObjectsAtLocation: function (x, y, group, callback, callbackContext, callbackArg) { this.quadTree.clear(); this.quadTree.reset(this.game.world.bounds.x, this.game.world.bounds.y, this.game.world.bounds.width, this.game.world.bounds.height, this.maxObjects, this.maxLevels); this.quadTree.populate(group); var rect = new Phaser.Rectangle(x, y, 1, 1); var output = []; var items = this.quadTree.retrieve(rect); for (var i = 0; i < items.length; i++) { if (items[i].hitTest(x, y)) { if (callback) { callback.call(callbackContext, callbackArg, items[i].sprite); } output.push(items[i].sprite); } } return output; }, /** * Move the given display object towards the destination object at a steady velocity. * If you specify a maxTime then it will adjust the speed (overwriting what you set) so it arrives at the destination in that number of seconds. * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) * * @method Phaser.Physics.Arcade#moveToObject * @param {any} displayObject - The display object to move. * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties. * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec) * @param {number} [maxTime=0] - Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms. * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity. */ moveToObject: function (displayObject, destination, speed, maxTime) { if (speed === undefined) { speed = 60; } if (maxTime === undefined) { maxTime = 0; } var angle = Math.atan2(destination.y - displayObject.y, destination.x - displayObject.x); if (maxTime > 0) { // We know how many pixels we need to move, but how fast? speed = this.distanceBetween(displayObject, destination) / (maxTime / 1000); } displayObject.body.velocity.x = Math.cos(angle) * speed; displayObject.body.velocity.y = Math.sin(angle) * speed; return angle; }, /** * Move the given display object towards the pointer at a steady velocity. If no pointer is given it will use Phaser.Input.activePointer. * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds. * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * * @method Phaser.Physics.Arcade#moveToPointer * @param {any} displayObject - The display object to move. * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec) * @param {Phaser.Pointer} [pointer] - The pointer to move towards. Defaults to Phaser.Input.activePointer. * @param {number} [maxTime=0] - Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms. * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity. */ moveToPointer: function (displayObject, speed, pointer, maxTime) { if (speed === undefined) { speed = 60; } pointer = pointer || this.game.input.activePointer; if (maxTime === undefined) { maxTime = 0; } var angle = this.angleToPointer(displayObject, pointer); if (maxTime > 0) { // We know how many pixels we need to move, but how fast? speed = this.distanceToPointer(displayObject, pointer) / (maxTime / 1000); } displayObject.body.velocity.x = Math.cos(angle) * speed; displayObject.body.velocity.y = Math.sin(angle) * speed; return angle; }, /** * Move the given display object towards the x/y coordinates at a steady velocity. * If you specify a maxTime then it will adjust the speed (over-writing what you set) so it arrives at the destination in that number of seconds. * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) * * @method Phaser.Physics.Arcade#moveToXY * @param {any} displayObject - The display object to move. * @param {number} x - The x coordinate to move towards. * @param {number} y - The y coordinate to move towards. * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec) * @param {number} [maxTime=0] - Time given in milliseconds (1000 = 1 sec). If set the speed is adjusted so the object will arrive at destination in the given number of ms. * @return {number} The angle (in radians) that the object should be visually set to in order to match its new velocity. */ moveToXY: function (displayObject, x, y, speed, maxTime) { if (speed === undefined) { speed = 60; } if (maxTime === undefined) { maxTime = 0; } var angle = Math.atan2(y - displayObject.y, x - displayObject.x); if (maxTime > 0) { // We know how many pixels we need to move, but how fast? speed = this.distanceToXY(displayObject, x, y) / (maxTime / 1000); } displayObject.body.velocity.x = Math.cos(angle) * speed; displayObject.body.velocity.y = Math.sin(angle) * speed; return angle; }, /** * Given the angle (in degrees) and speed calculate the velocity and return it as a Point object, or set it to the given point object. * One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object. * * @method Phaser.Physics.Arcade#velocityFromAngle * @param {number} angle - The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) * @param {number} [speed=60] - The speed it will move, in pixels per second sq. * @param {Phaser.Point|object} [point] - The Point object in which the x and y properties will be set to the calculated velocity. * @return {Phaser.Point} - A Point where point.x contains the velocity x value and point.y contains the velocity y value. */ velocityFromAngle: function (angle, speed, point) { if (speed === undefined) { speed = 60; } point = point || new Phaser.Point(); return point.setTo((Math.cos(this.game.math.degToRad(angle)) * speed), (Math.sin(this.game.math.degToRad(angle)) * speed)); }, /** * Given the rotation (in radians) and speed calculate the velocity and return it as a Point object, or set it to the given point object. * One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object. * * @method Phaser.Physics.Arcade#velocityFromRotation * @param {number} rotation - The angle in radians. * @param {number} [speed=60] - The speed it will move, in pixels per second sq. * @param {Phaser.Point|object} [point] - The Point object in which the x and y properties will be set to the calculated velocity. * @return {Phaser.Point} - A Point where point.x contains the velocity x value and point.y contains the velocity y value. */ velocityFromRotation: function (rotation, speed, point) { if (speed === undefined) { speed = 60; } point = point || new Phaser.Point(); return point.setTo((Math.cos(rotation) * speed), (Math.sin(rotation) * speed)); }, /** * Given the rotation (in radians) and speed calculate the acceleration and return it as a Point object, or set it to the given point object. * One way to use this is: accelerationFromRotation(rotation, 200, sprite.acceleration) which will set the values directly to the sprites acceleration and not create a new Point object. * * @method Phaser.Physics.Arcade#accelerationFromRotation * @param {number} rotation - The angle in radians. * @param {number} [speed=60] - The speed it will move, in pixels per second sq. * @param {Phaser.Point|object} [point] - The Point object in which the x and y properties will be set to the calculated acceleration. * @return {Phaser.Point} - A Point where point.x contains the acceleration x value and point.y contains the acceleration y value. */ accelerationFromRotation: function (rotation, speed, point) { if (speed === undefined) { speed = 60; } point = point || new Phaser.Point(); return point.setTo((Math.cos(rotation) * speed), (Math.sin(rotation) * speed)); }, /** * Sets the acceleration.x/y property on the display object so it will move towards the target at the given speed (in pixels per second sq.) * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * * @method Phaser.Physics.Arcade#accelerateToObject * @param {any} displayObject - The display object to move. * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties. * @param {number} [speed=60] - The speed it will accelerate in pixels per second. * @param {number} [xSpeedMax=500] - The maximum x velocity the display object can reach. * @param {number} [ySpeedMax=500] - The maximum y velocity the display object can reach. * @return {number} The angle (in radians) that the object should be visually set to in order to match its new trajectory. */ accelerateToObject: function (displayObject, destination, speed, xSpeedMax, ySpeedMax) { if (speed === undefined) { speed = 60; } if (xSpeedMax === undefined) { xSpeedMax = 1000; } if (ySpeedMax === undefined) { ySpeedMax = 1000; } var angle = this.angleBetween(displayObject, destination); displayObject.body.acceleration.setTo(Math.cos(angle) * speed, Math.sin(angle) * speed); displayObject.body.maxVelocity.setTo(xSpeedMax, ySpeedMax); return angle; }, /** * Sets the acceleration.x/y property on the display object so it will move towards the target at the given speed (in pixels per second sq.) * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * * @method Phaser.Physics.Arcade#accelerateToPointer * @param {any} displayObject - The display object to move. * @param {Phaser.Pointer} [pointer] - The pointer to move towards. Defaults to Phaser.Input.activePointer. * @param {number} [speed=60] - The speed it will accelerate in pixels per second. * @param {number} [xSpeedMax=500] - The maximum x velocity the display object can reach. * @param {number} [ySpeedMax=500] - The maximum y velocity the display object can reach. * @return {number} The angle (in radians) that the object should be visually set to in order to match its new trajectory. */ accelerateToPointer: function (displayObject, pointer, speed, xSpeedMax, ySpeedMax) { if (speed === undefined) { speed = 60; } if (pointer === undefined) { pointer = this.game.input.activePointer; } if (xSpeedMax === undefined) { xSpeedMax = 1000; } if (ySpeedMax === undefined) { ySpeedMax = 1000; } var angle = this.angleToPointer(displayObject, pointer); displayObject.body.acceleration.setTo(Math.cos(angle) * speed, Math.sin(angle) * speed); displayObject.body.maxVelocity.setTo(xSpeedMax, ySpeedMax); return angle; }, /** * Sets the acceleration.x/y property on the display object so it will move towards the x/y coordinates at the given speed (in pixels per second sq.) * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * * @method Phaser.Physics.Arcade#accelerateToXY * @param {any} displayObject - The display object to move. * @param {number} x - The x coordinate to accelerate towards. * @param {number} y - The y coordinate to accelerate towards. * @param {number} [speed=60] - The speed it will accelerate in pixels per second. * @param {number} [xSpeedMax=500] - The maximum x velocity the display object can reach. * @param {number} [ySpeedMax=500] - The maximum y velocity the display object can reach. * @return {number} The angle (in radians) that the object should be visually set to in order to match its new trajectory. */ accelerateToXY: function (displayObject, x, y, speed, xSpeedMax, ySpeedMax) { if (speed === undefined) { speed = 60; } if (xSpeedMax === undefined) { xSpeedMax = 1000; } if (ySpeedMax === undefined) { ySpeedMax = 1000; } var angle = this.angleToXY(displayObject, x, y); displayObject.body.acceleration.setTo(Math.cos(angle) * speed, Math.sin(angle) * speed); displayObject.body.maxVelocity.setTo(xSpeedMax, ySpeedMax); return angle; }, /** * Find the distance between two display objects (like Sprites). * * @method Phaser.Physics.Arcade#distanceBetween * @param {any} source - The Display Object to test from. * @param {any} target - The Display Object to test to. * @return {number} The distance between the source and target objects. */ distanceBetween: function (source, target) { var dx = source.x - target.x; var dy = source.y - target.y; return Math.sqrt(dx * dx + dy * dy); }, /** * Find the distance between a display object (like a Sprite) and the given x/y coordinates. * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters() * * @method Phaser.Physics.Arcade#distanceToXY * @param {any} displayObject - The Display Object to test from. * @param {number} x - The x coordinate to move towards. * @param {number} y - The y coordinate to move towards. * @return {number} The distance between the object and the x/y coordinates. */ distanceToXY: function (displayObject, x, y) { var dx = displayObject.x - x; var dy = displayObject.y - y; return Math.sqrt(dx * dx + dy * dy); }, /** * Find the distance between a display object (like a Sprite) and a Pointer. If no Pointer is given the Input.activePointer is used. * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters() * The distance to the Pointer is returned in screen space, not world space. * * @method Phaser.Physics.Arcade#distanceToPointer * @param {any} displayObject - The Display Object to test from. * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used. * @return {number} The distance between the object and the Pointer. */ distanceToPointer: function (displayObject, pointer) { pointer = pointer || this.game.input.activePointer; var dx = displayObject.x - pointer.worldX; var dy = displayObject.y - pointer.worldY; return Math.sqrt(dx * dx + dy * dy); }, /** * Find the angle in radians between two display objects (like Sprites). * * @method Phaser.Physics.Arcade#angleBetween * @param {any} source - The Display Object to test from. * @param {any} target - The Display Object to test to. * @return {number} The angle in radians between the source and target display objects. */ angleBetween: function (source, target) { var dx = target.x - source.x; var dy = target.y - source.y; return Math.atan2(dy, dx); }, /** * Find the angle in radians between a display object (like a Sprite) and the given x/y coordinate. * * @method Phaser.Physics.Arcade#angleToXY * @param {any} displayObject - The Display Object to test from. * @param {number} x - The x coordinate to get the angle to. * @param {number} y - The y coordinate to get the angle to. * @return {number} The angle in radians between displayObject.x/y to Pointer.x/y */ angleToXY: function (displayObject, x, y) { var dx = x - displayObject.x; var dy = y - displayObject.y; return Math.atan2(dy, dx); }, /** * Find the angle in radians between a display object (like a Sprite) and a Pointer, taking their x/y and center into account. * * @method Phaser.Physics.Arcade#angleToPointer * @param {any} displayObject - The Display Object to test from. * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used. * @return {number} The angle in radians between displayObject.x/y to Pointer.x/y */ angleToPointer: function (displayObject, pointer) { pointer = pointer || this.game.input.activePointer; var dx = pointer.worldX - displayObject.x; var dy = pointer.worldY - displayObject.y; return Math.atan2(dy, dx); }, /** * Find the angle in radians between a display object (like a Sprite) and a Pointer, * taking their x/y and center into account relative to the world. * * @method Phaser.Physics.Arcade#worldAngleToPointer * @param {any} displayObject - The DisplayObjerct to test from. * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used. * @return {number} The angle in radians between displayObject.world.x/y to Pointer.worldX / worldY */ worldAngleToPointer: function (displayObject, pointer) { pointer = pointer || this.game.input.activePointer; var dx = pointer.worldX - displayObject.world.x; var dy = pointer.worldY - displayObject.world.y; return Math.atan2(dy, dx); } };


USER_TOP_READ
Read access to a user's top artists and tracks.
Visible to users: Read your top artists and tracks.


Permissions
Following groups that are not from organization "{{project.organization}}" can read the
project:
{{gp.group.name}}
({{gp.group.organization}}){{ i < groupsOutsideOrganization.length - 1 ? ', ' : '' }}
.
0" nz-icon nzType="warning"
class="orange" nzTheme="fill" nz-popover [nzPopoverContent]="warnPermission"
nzPopoverPlacement="bottomLeft">
{{ 'project_advanced_title' | translate }}


Genuinely impressed, not gonna lie. Well, welcome to nothing. Here it isn't. Go back where you came from, okay?


Sabiha Gökçen (22 March 1913 – 22 March 2001) was a Turkish aviator.
She was the world's first female fighter pilot, aged 23. Others such
as Marie Marvingt and Evgeniya Shakhovskaya preceded her as military
pilots in other roles, but not as fighter pilots and without military
academy enrollment. She was an orphan, and one of the thirteen
adopted children of Mustafa Kemal Atatürk. She is recognized as the
first female combat pilot by The Guinness Book of World Records and
was selected as the only female pilot for the poster of "The 20
Greatest Aviators in History" published by the United States Air
Force in 1996.
Atatürk attached great importance to aviation and for that purpose
oversaw the foundation of the Turkish Aeronautical Association in
1925. He took Sabiha along with him to the opening ceremony of
Türkkuşu (Turkishbird) Flight School on 5 May 1935. During the
airshow of gliders and parachutists invited from foreign countries,
she got very excited. As Atatürk asked her whether she would also
want to become a skydiver, she nodded "yes indeed, I am ready right
now". Atatürk instructed Fuat Bulca, the head of the school, to
enroll her as the first female trainee. She was meant to become a
skydiver, but she was much more interested in flying, so she earned
her pilot's licence. Gökçen was sent to Russia, together with seven
male students, for an advanced course in glider and powered aircraft
piloting. However, when she was in Moscow, she learned the news that
her sister Zehra had died, and with collapsed morale, she immediately
returned to Turkey, isolating herself from social activities for some
time.
As girls were not being accepted by the Turkish War Academies in
those years, Sabiha Gökçen was provided, on Atatürk's orders, with
a personalized uniform, and attended a special education programme
of eleven months at the Tayyare Mektebi (Aviation School) in Eskişehir
in the academic year 1936-1937. After receiving her flight patents (diploma)
she trained to become a war pilot at the 1st Airplane Regiment in
Eskişehir for six months.
She improved her skills by flying bomber and fighter planes at the
1st Aircraft Regiment in Eskişehir Airbase and gained experience
after participating in the Aegean and Thrace exercises in 1937. In
that same year, she took part in military operations at the Dersim
rebellion and became the first Turkish female air force combat pilot.
A report of the General Staff mentioned the "serious damage" that
had been caused by her 50 kg bomb to a group of fifty fleeing
"bandits" and she was awarded with a takdirname
(letter of appreciation). She was also awarded the Turkish
Aeronautical Association's first "Murassa (Jeweled) Medal" for her
superior performance in this operation.
In 1938, she carried out a five-day flight around the Balkan
countries to great acclaim. In the same year, she was appointed
"chief trainer" of the Türkkuşu Flight School of the Turkish
Aeronautical Association, where she served until 1954 as a flight
instructor and became a member of the association's executive board.
She trained four female aviators, Edibe Subaşı, Yıldız Uçman,
Sahavet Karapas and Nezihe Viranyalı. Sabiha Gökçen flew around the
world for a period of 28 years until 1964. Her book entitled "A Life
Along the Path of Atatürk" was published in 1981 by the Turkish
Aeronautical Association to commemorate Atatürk's 100th birthday.
Throughout her career in the Turkish Air Force, Gökçen flew 22
different types of aircraft for more than 8,000 hours, 32 hours of
which were active combat and bombardment missions.
"Here's to strong women. May we know them. May we be them. May we raise them."
— Unknown


This task compiles F# source into executables or modules. The task requires fsc.exe on the execute path, unless it or an equivalent program is specified in the executable parameter
All parameters are optional: <fsc/>
should
suffice to produce a debug build of all *.fs files.
The task is a directory based task, so attributes like includes="**\/*.fs" and excludes="broken.fs" can be used to control the files pulled in. By default, all *.fs files from the project folder down are included in the command. When this happens the destFile -if not specified- is taken as the first file in the list, which may be somewhat hard to control. Specifying the output file with destfile is prudent.
Also, dependency checking only works if destfile is set. As
with <csc>
nested src filesets of
source, reference filesets, definitions and resources can be
provided.
| Attribute | Description | Type | Requirement |
| additionalmodules | Semicolon separated list of modules to refer to. | String | Optional |
| debug | set the debug flag on or off. | boolean | |
| destdir | Set the destination directory of files to be compiled. | File | |
| destfile | Set the name of exe/library to create. | File | |
| executable | set the name of the program, overriding the defaults. Can be used to set the full path to a program, or to switch to an alternate implementation of the command -provided they use the same command line arguments as the .NET framework edition | String | |
| extraoptions | Any extra options which are not explicitly supported by this task. | String | |
| failonerror | If true, fail on compilation errors. | boolean | |
| optimize | If true, enables optimization flag. | boolean | |
| tailcalls | Whether to enable tailcalls | boolean, defaults to true | |
| crossoptimize | Whether to enable cross-module optimizations. | boolean, defaults to false | |
| standalone | Whether to statically link the F# library and all referenced DLLs into the assembly. | boolean, defaults to false | |
| references | Semicolon separated list of DLLs to refer to. | String | |
| srcdir | Set the source directory of the files to be compiled. | File | |
| targettype | set the target type to one of exe|library|module|winexe | "exe", "library", "module", "winexe" | |
| utf8output | If true, require all compiler output to be in UTF8 format. | boolean | |
| warnlevel | Level of warning currently between 1 and 4 with 4 being the strictest. | int | |
| win32icon | Set the filename of icon to include. | File | |
| win32res | Sets the filename of a win32 resource (.RES) file to include. This is not a .NET resource, but what Windows is used to. | File | |
| useresponsefile | Sets whether a response file instead of a command line only invocation should be used. Defaults to false but Ant will still use a response file if more than 64 command line arguments would be used. | boolean |
add a define to the list of definitions
add a new reference fileset to the compilation
link or embed a resource
add a new source directory to the compile
<fsc optimize="true" debug="false" warnLevel="4" targetType="exe" definitions="RELEASE" excludes="src/unicode_class.fs" destFile="NetApp.exe" tailcalls="true" > <reference file="${testCSC.dll}"/> <define name="RELEASE"/> <define name="DEBUG" if="debug.property"/> <define name="def3" unless="def2.property"/> </fsc>
Apache Ant, Apache .NET Ant Library, Ant, .NET Ant Library, Apache, the Apache feather logo, and the Apache Ant project logos are trademarks of The Apache Software Foundation.


This text is always displayed. However, you cannot get to the rest of the content because the readmore link is hidden in a readmore element.
... read more This paragraph is only shown after the user clicks the "read more" link. And you can't do that, because it is hidden.
read less


| Created: | 4/19/2019 3:52:45 PM |
| Modified: | 4/26/2019 6:54:02 PM |
| Project: | |
| Advanced: |
| Attribute |
|
Private int keyType |
|
Details:
|
|
Private enum role |
|
Details:
|
|
Private int iso3883 |
|
Details:
|
|
Private enum hpmsType |
|
Details:
|
|
Private enum vehicleType |
|
Details:
|
|
Private enum responderEquip |
|
Details:
|
|
Private enum responderType |
|
Details:
|
|
Private int fuelType |
|
Details:
|
| Element | Source Role | Target Role |
|
SupplementalVehicleExtensions Class |
Name: classDetails |
Name: |
|
Details:
|
| Object | Type | Connection | Direction | Notes |
| SupplementalVehicleExtensions | Class | Strong | To |


|
Details Published Stories Subtopics Skills Topic Status |
|||||
|---|---|---|---|---|---|
| <[$ctrl.getSerialNumberForTopic($index)]>. |
|
<[topic.canonicalStoryCount]> |
<[topic.subtopicCount]> |
<[topic.totalSkillCount]>
!
|
Published Not Published |


AFFORDABLE & BEST USED CARS IN LAS VEGAS
We Are Here To Help You To Get Easy & Fast Car Loan Approval
2018 Discovery
2018 Discovery
2018 Discovery
Kilometers Driven- 40000
Sale Price-$40000
Buy Now2018 RAM 1500
2018 RAM 1500
Kilometers Driven- 30000
Sale Price-$30000
Buy Now2017 BMW 325i
2017 BMW 325i
Kilometers Driven- 35000
Sale Price-$32000
Buy NowClient Testimonials
Testimonial from Jaspreet Nagi
"This was one of my best purchasing experience as I got a very good condition car at a very reasonable price. Must visit place if you are planning to buy a car." Jaspreet Nagi, Las Vegas
Testimonial from Gagan Bhatt
"They have a good range of cars and you can easily find a perfect car for you as I found for me. Do check their collection you will be surprised by thier pricing." Gagan Bhatt, New York


Posted by Justin on December 17th, 2018
Posted by Justin on November 19th, 2018
Posted by Justin on November 14th, 2018
Posted by Justin on November 12th, 2018
Posted by Justin on November 2nd, 2018
Posted by Justin on November 1st, 2018
Posted by Justin on October 22nd, 2018
Posted by Justin on October 9th, 2018
Posted by Justin on September 18th, 2018
Posted by Justin on August 9th, 2018
Posted by Justin on August 6th, 2018
Posted by Justin on July 30th, 2018
Posted by Justin on July 9th, 2018
Posted by Justin on July 3rd, 2018
Posted by Justin on June 29, 2018
Posted by Justin on June 14, 2018
Posted by Justin on June 5, 2018
Posted by Justin on June 1, 2018
Posted by Justin on May 31, 2018
Posted by Justin on May 30, 2018
Posted by Justin on May 29, 2018
Posted by Shane on May 24, 2018