Skip to content

Commit

Permalink
Add Java3D. Modify .obj file to be compatible with Java3D.
Browse files Browse the repository at this point in the history
Give up on not checking in dependencies.

WIP on #12
  • Loading branch information
Andrew Brindamour committed Jan 11, 2016
1 parent bfcf548 commit e99109a
Show file tree
Hide file tree
Showing 234 changed files with 16,912 additions and 22 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
.project
bin/*
out/*
lib/*

18 changes: 1 addition & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,7 @@ The entry point to the program is located in the `ClientMain.java` file.
### IDE Configuration

#### Dependencies
You need to download the [Artemis Client Library v2.6.0](https://github.com/rjwut/ArtClientLib/releases). You may also want to install the source code as well so you can look at it while developing. You should place all dependencies in the `lib/` folder inside the repository. You may need to create this folder.

Inside the root of the project, run the following commands (Mac/Linux; on Windows, manually download and extract the Artemic Client Library):

cd <repository location, e.g. ~/workspace/ArtemisEngineeringClient>
mkdir lib
cd lib
curl -OL https://github.com/rjwut/ArtClientLib/releases/download/v2.6.0/artclientlib-2.6.0.jar
curl -L https://github.com/rjwut/ArtClientLib/archive/v2.6.0.tar.gz | tar -xzvf -

##### WIP Dependencies

Some of these may not be necessary.

1. [Guava](https://code.google.com/p/guava-libraries/)
1. [Ardor3D](https://github.com/Renanse/Ardor3D)
1. [JOGL](http://jogamp.org/jogl/www/) (missing dependencies for test code around this GitHub Repo: https://github.com/sgothel/jogl-demos/blob/master/src/demos/util/IntList.java)
Dependencies should be checked in, so you shouldn't have to download anything extra. This isn't the greatest thing to do, but we need a dependency management system before we can get rid of this.

#### Eclipse

Expand Down
1 change: 0 additions & 1 deletion art/models/obj-from-blender/artemis2.obj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Blender v2.76 (sub 0) OBJ File: ''
# www.blender.org
mtllib artemis2.mtl
o low_artemis
v -67.388069 -13.950224 -220.467407
v -66.821869 -14.627622 -236.405701
v -82.816383 -14.198822 -236.405701
Expand Down
Binary file added lib/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions lib/ArtClientLib-2.6.0/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
7 changes: 7 additions & 0 deletions lib/ArtClientLib-2.6.0/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
language: java
sudo: false
jdk:
- oraclejdk8
- oraclejdk7
- openjdk7
- openjdk6
68 changes: 68 additions & 0 deletions lib/ArtClientLib-2.6.0/build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<project name="artclientlib" basedir="." default="jar">
<property name="srcPath" value="src"/>
<property name="testPath" value="test"/>
<property name="buildPath" value="build"/>
<property name="buildPath.src" value="${buildPath}/src/classes"/>
<property name="buildPath.test" value="${buildPath}/test/classes"/>
<property name="buildPath.junit" value="junitlib"/>
<property name="jvm.source" value="1.6"/>
<property name="jvm.target" value="1.6"/>
<property name="version" value="2.6.0"/>

<path id="testBuildClasspath">
<pathelement path="${buildPath.src}"/>
<fileset dir="${buildPath.junit}">
<include name="*.jar"/>
</fileset>
</path>

<path id="testClasspath">
<pathelement path="${buildPath.src}"/>
<pathelement path="${buildPath.test}"/>
<fileset dir="${buildPath.junit}">
<include name="*.jar"/>
</fileset>
</path>

<target name="clean">
<delete dir="${buildPath}"/>
</target>

<target name="compile" depends="clean">
<mkdir dir="${buildPath.src}"/>
<javac srcdir="${srcPath}" destdir="${buildPath.src}" source="${jvm.source}" target="${jvm.target}" includeantruntime="no" debug="yes" debuglevel="lines,vars,source"/>
<copy todir="${buildPath.src}">
<fileset dir="${srcPath}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>

<target name="compileTest" depends="compile">
<mkdir dir="${buildPath.test}"/>
<javac srcdir="${testPath}" destdir="${buildPath.test}" source="${jvm.source}" target="${jvm.target}" includeantruntime="yes" debug="yes" debuglevel="lines,vars,source">
<classpath refid="testBuildClasspath"/>
</javac>
<copy todir="${buildPath.test}">
<fileset dir="${testPath}">
<exclude name="**/*.java"/>
</fileset>
</copy>
</target>

<target name="test" depends="compileTest">
<junit>
<formatter type="plain" usefile="false"/>
<classpath refid="testClasspath"/>
<batchtest>
<fileset dir="${testPath}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>

<target name="jar" depends="test">
<jar destfile="${buildPath}/${ant.project.name}-${version}.jar" basedir="${buildPath.src}"/>
</target>
</project>
Binary file not shown.
Binary file added lib/ArtClientLib-2.6.0/junitlib/junit-4.11.jar
Binary file not shown.
15 changes: 15 additions & 0 deletions lib/ArtClientLib-2.6.0/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ArtClientLib
============
[![Build Status](https://secure.travis-ci.org/rjwut/ArtClientLib.svg)](http://travis-ci.org/rjwut/ArtClientLib)

**ArtClientLib** is an _unofficial_ Java library for communicating with [Artemis Spaceship Bridge Simulator](http://www.artemis.eochu.com/) servers and clients.

Documentation for the project is found on the [wiki](https://github.com/rjwut/ArtClientLib/wiki). Please also read the [disclaimer](https://github.com/rjwut/ArtClientLib/wiki/Disclaimer) before using ArtClientLib.

ArtClientLib does not maintain backwards compatibility when updating for new versions of Artemis. The current release supports version 2.1.1. The list below provides links to the latest release of ArtClientLib to support various previous versions. Keep in mind that current documentation will differ significantly from these past versions.

* Artemis v2.1: [ArtClientLib v2.4.0](https://github.com/rjwut/ArtClientLib/releases/tag/v2.4.0)
* Artemis v2.0: [ArtClientLib v2.3.0](https://github.com/rjwut/ArtClientLib/releases/tag/v2.3.0)
* Artemis v1.x: [ArtClientLib v1.x](https://github.com/dhleong/ArtClientLib) (by Daniel Leong)

ArtClientLib was originally developed by Daniel Leong and released on GitHub with permission of the developer of Artemis, Thom Robertson.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package net.dhleong.acl.enums;

public enum AlertStatus {
NORMAL,
RED
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package net.dhleong.acl.enums;

public enum AudioCommand {
PLAY,
DISMISS
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package net.dhleong.acl.enums;

public enum AudioMode {
PLAYING,
INCOMING
}
40 changes: 40 additions & 0 deletions lib/ArtClientLib-2.6.0/src/net/dhleong/acl/enums/BaseMessage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package net.dhleong.acl.enums;

/**
* Messages that can be sent to bases.
* @author rjwut
*/
public enum BaseMessage implements CommsMessage {
STAND_BY_FOR_DOCKING("Stand by for docking."),
PLEASE_REPORT_STATUS("Please report status."),
BUILD_HOMING_MISSILES("Please build type 1 homing ordnance for us."),
BUILD_NUKES("Please build type 4 nuke ordnance for us."),
BUILD_MINES("Please build type 6 mine ordnance for us."),
BUILD_EMPS("Please build type 9 EMP ordnance for us.");

private String label;

BaseMessage(String label) {
this.label = label;
}

@Override
public String toString() {
return label;
}

@Override
public boolean hasArgument() {
return false;
}

@Override
public int getId() {
return ordinal();
}

@Override
public CommsRecipientType getRecipientType() {
return CommsRecipientType.BASE;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package net.dhleong.acl.enums;

/**
* The available frequencies to which beams can be tuned.
* @author rjwut
*/
public enum BeamFrequency {
A, B, C, D, E
}
23 changes: 23 additions & 0 deletions lib/ArtClientLib-2.6.0/src/net/dhleong/acl/enums/CommsMessage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package net.dhleong.acl.enums;

/**
* All messages that can be sent over COMMs implement this interface.
* @author rjwut
*/
public interface CommsMessage {
/**
* Returns the ID of this CommsMessage. IDs are unique per
* CommsRecipientType.
*/
public int getId();

/**
* Returns the CommsTargetType that can recieve this CommsMessage.
*/
public CommsRecipientType getRecipientType();

/**
* Returns whether or not this message has an argument.
*/
public boolean hasArgument();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
package net.dhleong.acl.enums;

import net.dhleong.acl.util.BoolState;
import net.dhleong.acl.vesseldata.Vessel;
import net.dhleong.acl.world.ArtemisNpc;
import net.dhleong.acl.world.ArtemisObject;

/**
* The types of ArtemisObjects to which players can send COMMs messages.
* @author rjwut
*/
public enum CommsRecipientType {
/**
* Other player ships
*/
PLAYER {
@Override
public CommsMessage messageFromId(int id) {
return PlayerMessage.values()[id];
}
},
/**
* NCP enemy ships
*/
ENEMY {
@Override
public CommsMessage messageFromId(int id) {
return EnemyMessage.values()[id];
}
},
/**
* Bases
*/
BASE {
@Override
public CommsMessage messageFromId(int id) {
return BaseMessage.values()[id];
}
},
/**
* Other (civilian NPCs)
*/
OTHER {
@Override
public CommsMessage messageFromId(int id) {
return OtherMessage.fromId(id);
}
};

/**
* Returns the CommsRecipientType that corresponds to the given
* ArtemisObject; or null if the object in question cannot receive COMMs
* messages.
*/
public static CommsRecipientType fromObject(ArtemisObject obj) {
ObjectType type = obj.getType();

switch (type) {
case PLAYER_SHIP:
return PLAYER;
case BASE:
return BASE;
case NPC_SHIP:
ArtemisNpc npc = (ArtemisNpc) obj;
Vessel vessel = npc.getVessel();
boolean enemy;

if (vessel != null) {
enemy = vessel.getFaction().is(FactionAttribute.ENEMY);
} else {
enemy = BoolState.safeValue(npc.isEnemy());
}

return enemy ? ENEMY : OTHER;
default:
return null;
}
}

/**
* Returns the CommsMessage value that corresponds to the given message ID.
*/
public abstract CommsMessage messageFromId(int id);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package net.dhleong.acl.enums;

/**
* Represents the type of the machine found at the opposite end of a connection.
* @author rjwut
*/
public enum ConnectionType {
SERVER, CLIENT;

/**
* Returns the ConnectionType that corresponds to the given int value.
*/
public static final ConnectionType fromInt(int value) {
return value == 1 ? SERVER : (value == 2 ? CLIENT : null);
}

private int val;

ConnectionType() {
val = ordinal() + 1;
}

/**
* Returns the int value for this ConnectionType.
*/
public int toInt() {
return val;
}

/**
* Returns the opposite ConnectionType to this one: SERVER.opposite()
* returns CLIENT and vice-versa.
*/
public ConnectionType opposite() {
return this == SERVER ? CLIENT : SERVER;
}
}
29 changes: 29 additions & 0 deletions lib/ArtClientLib-2.6.0/src/net/dhleong/acl/enums/Console.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package net.dhleong.acl.enums;

/**
* The bridge conoles.
* @author rjwut
*/
public enum Console {
MAIN_SCREEN("Main screen"),
HELM("Helm"),
WEAPONS("Weapons"),
ENGINEERING("Engineering"),
SCIENCE("Science"),
COMMUNICATIONS("Communications"),
DATA("Data"),
OBSERVER("Observer"),
CAPTAINS_MAP("Captain's map"),
GAME_MASTER("Game master");

private String label;

Console(String label) {
this.label = label;
}

@Override
public String toString() {
return label;
}
}
Loading

0 comments on commit e99109a

Please sign in to comment.