Skip to content

Commit 92b3bbb

Browse files
committed
Merge pull request #1 from ruby-processing/independent
Independent
2 parents 40d4abd + dd756fe commit 92b3bbb

145 files changed

Lines changed: 29427 additions & 78 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.mvn/extensions.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<extensions>
3+
<extension>
4+
<groupId>io.takari.polyglot</groupId>
5+
<artifactId>polyglot-ruby</artifactId>
6+
<version>0.1.15</version>
7+
</extension>
8+
</extensions>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.3/apache-maven-3.3.3-bin.zip

Rakefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ end
2525
desc 'Compile'
2626
task :compile do
2727
sh "mvn package"
28-
sh "cp ${HOME}/jbox2d/jbox2d-library/target/jbox2d-library-2.3.1-SNAPSHOT.jar lib"
2928
sh "mv target/box2d.jar lib"
3029
end
3130

3231
desc 'Build Gem'
3332
task :gem do
34-
sh "gem build pbox2d.gemspec"
33+
sh "gem build pbox2d.gemspec"
3534
end
3635

3736
Rake::TestTask.new do |t|

lib/pbox2d/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# module to give version a namespace
22
module Pbox2d
3-
VERSION = '0.6.0'
3+
VERSION = '0.7.0'
44
end

pbox2d.gemspec

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ EOF
2020
spec.homepage = 'https://github.com/ruby-processing/jbox2d'
2121
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
2222
spec.files << 'lib/box2d.jar'
23-
spec.files << 'lib/jbox2d-library-2.3.1-SNAPSHOT.jar'
2423
spec.require_paths = ['lib']
2524
spec.add_dependency 'jruby_art', '~> 1.0'
2625
spec.add_development_dependency "rake", "~> 10.0"

pom.rb

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
require 'fileutils'
2+
project 'pbox2d', 'https://github.com/ruby-processing/jbox2d' do
3+
4+
model_version '4.0.0'
5+
id 'ruby-processing:pbox2d', '0.7'
6+
packaging 'jar'
7+
8+
description 'jbox2d for JRubyArt'
9+
10+
organization 'ruby-processing', 'https://ruby-processing.github.io'
11+
12+
developer 'monkstone' do
13+
name 'Martin Prout'
14+
email 'martin_p@lineone.net'
15+
roles 'developer'
16+
end
17+
18+
license 'BSD-2-clause', 'http://www.opensource.org/licenses/bsd-license.php'
19+
20+
issue_management 'https://github.com/ruby-processing/jbox2d/issues', 'Github'
21+
22+
source_control(
23+
:url => 'https://github.com/ruby-processing/jbox2d',
24+
:connection => 'scm:git:git://github.com/ruby-processing/jbox2d.git',
25+
:developer_connection => 'scm:git:git@github.com/ruby-processing/jbox2dt.git'
26+
)
27+
28+
properties( 'maven.compiler.source' => '1.8',
29+
'project.build.sourceEncoding' => 'UTF-8',
30+
'maven.compiler.target' => '1.8',
31+
'polyglot.dump.pom' => 'pom.xml',
32+
'processing.api' => "http://processing.github.io/processing-javadocs/core/",
33+
'jruby.api' => "http://jruby.org/apidocs/"
34+
)
35+
36+
pom 'org.jruby:jruby:9.0.4.0'
37+
jar 'org.processing:core:3.0.1'
38+
plugin_management do
39+
plugin :resources, '2.6'
40+
plugin :dependency, '2.8'
41+
plugin( :compiler, '3.1',
42+
'source' => '1.8',
43+
'target' => '1.8' )
44+
plugin( :javadoc, '2.10.3',
45+
'detectOfflineLinks' => 'false',
46+
'links' => ['${processing.api}', '${jruby.api}']
47+
)
48+
plugin( :jar, '2.4',
49+
'archive' => {
50+
'manifestFile' => 'MANIFEST.MF'
51+
}
52+
)
53+
end
54+
build do
55+
default_goal 'package'
56+
source_directory 'src'
57+
final_name 'box2d'
58+
end
59+
end

pom.xml

Lines changed: 81 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,111 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<groupId>org.ruby-processing</groupId>
5-
<artifactId>box2d</artifactId>
6-
<version>0.6.0</version>
7-
<packaging>jar</packaging>
8-
<description>
9-
jbox2d-library for JRubyArt
10-
</description>
11-
12-
<parent>
13-
<groupId>org.sonatype.oss</groupId>
14-
<artifactId>oss-parent</artifactId>
15-
<version>7</version>
16-
</parent>
17-
18-
<issueManagement>
19-
<system>Github</system>
20-
<url>https://github.com/ruby-processing/jbox2d/issues</url>
21-
</issueManagement>
2+
<!--
223
23-
<scm>
24-
<connection>scm:git:git://github.com/ruby-processing/jbox2d.git</connection>
25-
<developerConnection>scm:git:git@github.com:ruby-processing/jbox2d.git</developerConnection>
26-
<url>https://github.com/ruby-processing/jbox2d</url>
27-
</scm>
4+
Auto-generated do not edit
285
6+
-->
7+
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
8+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
9+
<modelVersion>4.0.0</modelVersion>
10+
<groupId>ruby-processing</groupId>
11+
<artifactId>pbox2d</artifactId>
12+
<version>0.7</version>
13+
<name>pbox2d</name>
14+
<description>jbox2d for JRubyArt</description>
15+
<url>https://github.com/ruby-processing/jbox2d</url>
16+
<organization>
17+
<name>ruby-processing</name>
18+
<url>https://ruby-processing.github.io</url>
19+
</organization>
2920
<licenses>
3021
<license>
3122
<name>BSD-2-clause</name>
3223
<url>http://www.opensource.org/licenses/bsd-license.php</url>
3324
</license>
3425
</licenses>
35-
3626
<developers>
3727
<developer>
3828
<id>monkstone</id>
3929
<name>Martin Prout</name>
4030
<email>martin_p@lineone.net</email>
31+
<roles>
32+
<role>developer</role>
33+
</roles>
4134
</developer>
4235
</developers>
43-
36+
<scm>
37+
<connection>scm:git:git://github.com/ruby-processing/jbox2d.git</connection>
38+
<developerConnection>scm:git:git@github.com/ruby-processing/jbox2dt.git</developerConnection>
39+
<url>https://github.com/ruby-processing/jbox2d</url>
40+
</scm>
41+
<issueManagement>
42+
<system>Github</system>
43+
<url>https://github.com/ruby-processing/jbox2d/issues</url>
44+
</issueManagement>
45+
<properties>
46+
<processing.api>http://processing.github.io/processing-javadocs/core/</processing.api>
47+
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
48+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
49+
<maven.compiler.source>1.8</maven.compiler.source>
50+
<jruby.api>http://jruby.org/apidocs/</jruby.api>
51+
<maven.compiler.target>1.8</maven.compiler.target>
52+
</properties>
4453
<dependencies>
4554
<dependency>
46-
<groupId>org.jbox2d</groupId>
47-
<artifactId>jbox2d-library</artifactId>
48-
<version>2.3.1-SNAPSHOT</version>
49-
<scope>system</scope>
50-
<systemPath>${jbox2d.home}/jbox2d-library-2.3.1-SNAPSHOT.jar</systemPath>
55+
<groupId>org.jruby</groupId>
56+
<artifactId>jruby</artifactId>
57+
<version>9.0.4.0</version>
58+
<type>pom</type>
5159
</dependency>
5260
<dependency>
5361
<groupId>org.processing</groupId>
5462
<artifactId>core</artifactId>
55-
<scope>system</scope>
5663
<version>3.0.1</version>
57-
<systemPath>${processing.home}/core/library/core.jar</systemPath>
5864
</dependency>
5965
</dependencies>
60-
<properties>
61-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
62-
<maven.compiler.source>1.8</maven.compiler.source>
63-
<maven.compiler.target>1.8</maven.compiler.target>
64-
<!-- for Mac developers, non Archlinux and Windows can probably figure it out
65-
<processing.home>/Applications/Processing.app/Contents/Java</processing.home>
66-
-->
67-
<processing.home>/usr/share/processing</processing.home>
68-
<jbox2d.home>${user.home}/jbox2d/jbox2d-library/target</jbox2d.home>
69-
</properties>
7066
<build>
7167
<sourceDirectory>src</sourceDirectory>
68+
<defaultGoal>package</defaultGoal>
7269
<finalName>box2d</finalName>
73-
<extensions>
74-
<extension>
75-
<groupId>org.apache.maven.wagon</groupId>
76-
<artifactId>wagon-webdav-jackrabbit</artifactId>
77-
<version>2.1</version>
78-
</extension>
79-
</extensions>
80-
<plugins>
81-
<plugin>
82-
<artifactId>maven-compiler-plugin</artifactId>
83-
<version>3.1</version>
84-
<configuration>
85-
<source>1.8</source>
86-
<target>1.8</target>
87-
</configuration>
88-
</plugin>
89-
<plugin>
90-
<artifactId>maven-jar-plugin</artifactId>
91-
<version>2.4</version>
92-
<configuration>
93-
<archive>
94-
<manifestFile>MANIFEST.MF</manifestFile>
95-
</archive>
96-
</configuration>
97-
</plugin>
98-
<plugin>
99-
<artifactId>maven-resources-plugin</artifactId>
100-
<version>2.6</version>
101-
</plugin>
102-
</plugins>
70+
<pluginManagement>
71+
<plugins>
72+
<plugin>
73+
<artifactId>maven-resources-plugin</artifactId>
74+
<version>2.6</version>
75+
</plugin>
76+
<plugin>
77+
<artifactId>maven-dependency-plugin</artifactId>
78+
<version>2.8</version>
79+
</plugin>
80+
<plugin>
81+
<artifactId>maven-compiler-plugin</artifactId>
82+
<version>3.1</version>
83+
<configuration>
84+
<source>1.8</source>
85+
<target>1.8</target>
86+
</configuration>
87+
</plugin>
88+
<plugin>
89+
<artifactId>maven-javadoc-plugin</artifactId>
90+
<version>2.10.3</version>
91+
<configuration>
92+
<detectOfflineLinks>false</detectOfflineLinks>
93+
<links>
94+
<link>${processing.api}</link>
95+
<link>${jruby.api}</link>
96+
</links>
97+
</configuration>
98+
</plugin>
99+
<plugin>
100+
<artifactId>maven-jar-plugin</artifactId>
101+
<version>2.4</version>
102+
<configuration>
103+
<archive>
104+
<manifestFile>MANIFEST.MF</manifestFile>
105+
</archive>
106+
</configuration>
107+
</plugin>
108+
</plugins>
109+
</pluginManagement>
103110
</build>
104111
</project>

src/org/jbox2d/JBox2D.gwt.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.2.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.2.0/distro-source/core/src/gwt-module.dtd">
3+
<module>
4+
<inherits name="com.google.gwt.user.User" />
5+
<source path="callbacks"/>
6+
<source path="collision"/>
7+
<source path="common"/>
8+
<source path="dynamics"/>
9+
<source path="pooling"/>
10+
11+
<super-source path="gwtemul" />
12+
</module>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2013, Daniel Murphy
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without modification,
6+
* are permitted provided that the following conditions are met:
7+
* * Redistributions of source code must retain the above copyright notice,
8+
* this list of conditions and the following disclaimer.
9+
* * Redistributions in binary form must reproduce the above copyright notice,
10+
* this list of conditions and the following disclaimer in the documentation
11+
* and/or other materials provided with the distribution.
12+
*
13+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16+
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
17+
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
19+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
20+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
22+
* POSSIBILITY OF SUCH DAMAGE.
23+
******************************************************************************/
24+
/**
25+
* Created at 4:25:42 AM Jul 15, 2010
26+
*/
27+
package org.jbox2d.callbacks;
28+
29+
import org.jbox2d.dynamics.Filter;
30+
import org.jbox2d.dynamics.Fixture;
31+
32+
// updated to rev 100
33+
/**
34+
* Implement this class to provide collision filtering. In other words, you can implement
35+
* this class if you want finer control over contact creation.
36+
* @author Daniel Murphy
37+
*/
38+
public class ContactFilter {
39+
40+
/**
41+
* Return true if contact calculations should be performed between these two shapes.
42+
* @warning for performance reasons this is only called when the AABBs begin to overlap.
43+
* @param fixtureA
44+
* @param fixtureB
45+
* @return
46+
*/
47+
public boolean shouldCollide(Fixture fixtureA, Fixture fixtureB){
48+
Filter filterA = fixtureA.getFilterData();
49+
Filter filterB = fixtureB.getFilterData();
50+
51+
if (filterA.groupIndex == filterB.groupIndex && filterA.groupIndex != 0){
52+
return filterA.groupIndex > 0;
53+
}
54+
55+
boolean collide = (filterA.maskBits & filterB.categoryBits) != 0 &&
56+
(filterA.categoryBits & filterB.maskBits) != 0;
57+
return collide;
58+
}
59+
}

0 commit comments

Comments
 (0)