Merge branch 'master' of github.com:ProjectSWGCore/NGECore2

This commit is contained in:
darkk1138
2013-12-09 22:54:57 +01:00
18 changed files with 125 additions and 191 deletions
Binary file not shown.
@@ -3,12 +3,9 @@ from java.util import Vector
from resources.common import SpawnPoint
def setup(core, object):
stcSvc = core.staticService
cell = object.getCellByCellNumber(2)
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_cloning.iff', object.getPlanet().getName(), cell.getObjectID(), float(1), float(-0.05), float(2.5), float(0), float(1))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_cloning.iff', object.getPlanet().getName(), cell.getObjectID(), float(1), float(-0.05), float(-1.35), float(1), float(0))
objSvc = core.objectService
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_cloning.iff', float(1), float(-0.05), float(2.5), float(0), float(1), 2)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_cloning.iff', float(1), float(-0.05), float(-1.35), float(1), float(0), 2)
spawnPoints = Vector()
spawnPoints.add(SpawnPoint(-16.6514, -4.29167, -10.4976, 0.709453, 0.704753, 4))
@@ -1,16 +1,11 @@
import sys
def setup(core, object):
stcSvc = core.staticService
cell = object.getCellByCellNumber(4)
objSvc = core.objectService
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(11.5), float(0.6), float(51.3), float(0.195405), float(-0.980722))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(3.1), float(0.6), float(49), float(0), float(1))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-2.7), float(0.6), float(49), float(0), float(1))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-13.2), float(0.6), float(51.3), float(-0.195405), float(-0.980722))
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(11.5), float(0.6), float(51.3), float(0.195405), float(-0.980722), 4)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(3.1), float(0.6), float(49), float(0), float(1), 4)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(-2.7), float(0.6), float(49), float(0), float(1), 4)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(-13.2), float(0.6), float(51.3), float(-0.195405), float(-0.980722), 4)
objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport.iff', 0, 0, 0, 1, 0)
objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 10, 0, -10, 0.707107, 0.707107)
core.mapService.addLocation(object.getPlanet(), 'Starport', object.getPosition().x, object.getPosition().z, 15, 0, 0)
@@ -3,12 +3,9 @@ from java.util import Vector
from resources.common import SpawnPoint
def setup(core, object):
stcSvc = core.staticService
cell = object.getCellByCellNumber(3)
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_cloning.iff', object.getPlanet().getName(), cell.getObjectID(), float(0.0387871), float(0.125265), float(-6), float(-0.0595427), float(0.998226))
objSvc = core.objectService
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_cloning.iff', float(0.0387871), float(0.125265), float(-6), float(-0.0595427), float(0.998226), 3)
spawnPoints = Vector()
spawnPoints.add(SpawnPoint(3.2408, 0.125266, -3.59732, 0.707641, -0.706572, 5))
@@ -3,12 +3,9 @@ from java.util import Vector
from resources.common import SpawnPoint
def setup(core, object):
stcSvc = core.staticService
cell = object.getCellByCellNumber(6)
objSvc = core.objectService
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_cloning.iff', float(-5.5), float(0.125265), float(-3.43841), float(0.699512), float(0.714621), 6)
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_cloning.iff', object.getPlanet().getName(), cell.getObjectID(), float(-5.5), float(0.125265), float(-3.43841), float(0.699512), float(0.714621))
spawnPoints = Vector()
spawnPoints.add(SpawnPoint(4.44727, 0.125266, -3.80136, -0.706468, 0.707745, 5))
spawnPoints.add(SpawnPoint(4.65395, 0.125266, 1.49466, 0.714548, -0.699587, 4))
@@ -3,11 +3,8 @@ from java.util import Vector
from resources.common import SpawnPoint
def setup(core, object):
stcSvc = core.staticService
cell = object.getCellByCellNumber(3)
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_cloning.iff', object.getPlanet().getName(), cell.getObjectID(), float(-0.134662), float(0.125265), float(-5.80915), float(-0.0238176), float(0.998716))
objSvc = core.objectService
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_cloning.iff', float(-0.134662), float(0.125265), float(-5.80915), float(-0.0238176), float(0.998716), 3)
spawnPoints = Vector()
spawnPoints.add(SpawnPoint(4.42891, 0.125266, -3.717, 0.712528, -0.701643, 5))
@@ -1,16 +1,9 @@
import sys
def setup(core, object):
stcSvc = core.staticService
objSvc = core.objectService
objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport.iff', 0, 7, 0, 0.707107, 0.707107)
objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 1, 0, -10, 0, 1)
cell = object.getCellByCellNumber(1)
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-3.12), float(0.14659503), float(-17.57), float(0.707107), float(-0.707107))
return
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(-3.12), float(0.14659503), float(-17.57), float(0.707107), float(-0.707107), 1)
return
@@ -3,12 +3,9 @@ from java.util import Vector
from resources.common import SpawnPoint
def setup(core, object):
stcSvc = core.staticService
cell = object.getCellByCellNumber(2)
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_cloning.iff', object.getPlanet().getName(), cell.getObjectID(), float(1), float(-0.05), float(2.5), float(0), float(1))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_cloning.iff', object.getPlanet().getName(), cell.getObjectID(), float(1), float(-0.05), float(-1.35), float(1), float(0))
objSvc = core.objectService
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_cloning.iff', float(1), float(-0.05), float(2.5), float(0), float(1), 2)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_cloning.iff', float(1), float(-0.05), float(-1.35), float(1), float(0), 2)
spawnPoints = Vector()
spawnPoints.add(SpawnPoint(-16.6514, -4.29167, -10.4976, 0.709453, 0.704753, 4))
@@ -1,18 +1,14 @@
import sys
def setup(core, object):
stcSvc = core.staticService
cell = object.getCellByCellNumber(3)
cell2 = object.getCellByCellNumber(4)
cell3 = object.getCellByCellNumber(5)
objSvc = core.objectService
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-26.94), float(0.749), float(-67.14), float(1), float(0))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell2.getObjectID(), float(26.94), float(0.749), float(-67.14), float(1), float(0))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell3.getObjectID(), float(-9.49), float(7.979), float(-45.2359), float(0), float(1))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell3.getObjectID(), float(9.49), float(7.979), float(-45.2359), float(0), float(1))
stcSvc.spawnObject('object/tangible/travel/ticket_collector/shared_ticket_collector.iff', object.getPlanet().getName(), cell3.getObjectID(), float(-10), float(7.979), float(10), float(-0.707107), float(0.707107))
stcSvc.spawnObject('object/creature/npc/theme_park/shared_player_transport_theed_hangar.iff', object.getPlanet().getName(), cell3.getObjectID(), float(0), float(7.979), float(0), float(1), float(1))
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(-26.94), float(0.749), float(-67.14), float(1), float(0), 3)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(26.94), float(0.749), float(-67.14), float(1), float(0), 4)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(-9.49), float(7.979), float(-45.2359), float(0), float(1), 5)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(9.49), float(7.979), float(-45.2359), float(0), float(1), 5)
objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', float(-10), float(7.979), float(10), float(-0.707107), float(0.707107), 5)
objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport_theed_hangar.iff', float(0), float(7.979), float(0), float(1), float(1), 5)
core.mapService.addLocation(object.getPlanet(), 'Starport', object.getPosition().x, object.getPosition().z, 15, 0, 0)
@@ -1,14 +1,8 @@
import sys
def setup(core, object):
stcSvc = core.staticService
objSvc = core.objectService
objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport.iff', 0, 7, 0, 0.707107, 0.707107)
objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 1, 0, -10, 0, 1)
cell = object.getCellByCellNumber(1)
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-3.12), float(0.14659503), float(-17.57), float(0.707107), float(-0.707107))
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(-3.12), float(0.14659503), float(-17.57), float(0.707107), float(-0.707107), 1)
return
@@ -1,15 +1,11 @@
import sys
def setup(core, object):
stcSvc = core.staticService
cell = object.getCellByCellNumber(4)
objSvc = core.objectService
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(11.5), float(0.6), float(51.3), float(0.195405), float(-0.980722))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(3.1), float(0.6), float(49), float(0), float(1))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-2.7), float(0.6), float(49), float(0), float(1))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-13.2), float(0.6), float(51.3), float(-0.195405), float(-0.980722))
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(11.5), float(0.6), float(51.3), float(0.195405), float(-0.980722), 4)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(3.1), float(0.6), float(49), float(0), float(1), 4)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(-2.7), float(0.6), float(49), float(0), float(1), 4)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(-13.2), float(0.6), float(51.3), float(-0.195405), float(-0.980722), 4)
objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport.iff', 0, 0, 0, 1, 0)
objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 10, 0, -10, 0.707107, 0.707107)
core.mapService.addLocation(object.getPlanet(), 'Starport', object.getPosition().x, object.getPosition().z, 15, 0, 0)
@@ -3,12 +3,9 @@ from java.util import Vector
from resources.common import SpawnPoint
def setup(core, object):
stcSvc = core.staticService
cell = object.getCellByCellNumber(2)
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_cloning.iff', object.getPlanet().getName(), cell.getObjectID(), float(1), float(-0.05), float(2.5), float(0), float(1))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_cloning.iff', object.getPlanet().getName(), cell.getObjectID(), float(1), float(-0.05), float(-1.35), float(1), float(0))
objSvc = core.objectService
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_cloning.iff', float(1), float(-0.05), float(2.5), float(0), float(1), 2)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_cloning.iff', float(1), float(-0.05), float(-1.35), float(1), float(0), 2)
spawnPoints = Vector()
spawnPoints.add(SpawnPoint(-16.6514, -4.29167, -10.4976, 0.709453, 0.704753, 4))
@@ -3,12 +3,9 @@ from java.util import Vector
from resources.common import SpawnPoint
def setup(core, object):
stcSvc = core.staticService
cell = object.getCellByCellNumber(10)
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_cloning.iff', object.getPlanet().getName(), cell.getObjectID(), float(-0.42), float(-0.38), float(-0.4), float(1), float(0))
objSvc = core.objectService
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_cloning.iff', float(-0.42), float(-0.38), float(-0.4), float(1), float(0), 10)
spawnPoints = Vector()
spawnPoints.add(SpawnPoint(0.445015, 0.271775, 1.39199, 0.707038, 0.707176, 9))
@@ -1,14 +1,11 @@
import sys
def setup(core, object):
stcSvc = core.staticService
cell = object.getCellByCellNumber(4)
objSvc = core.objectService
if cell:
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(11.5), float(0.6), float(51.3), float(0.195405), float(-0.980722))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(3.1), float(0.6), float(49), float(0), float(1))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-2.7), float(0.6), float(49), float(0), float(1))
stcSvc.spawnObject('object/tangible/terminal/shared_terminal_travel.iff', object.getPlanet().getName(), cell.getObjectID(), float(-13.2), float(0.6), float(51.3), float(-0.195405), float(-0.980722))
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(11.5), float(0.6), float(51.3), float(0.195405), float(-0.980722), 4)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(3.1), float(0.6), float(49), float(0), float(1), 4)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(-2.7), float(0.6), float(49), float(0), float(1), 4)
objSvc.createChildObject(object, 'object/tangible/terminal/shared_terminal_travel.iff', float(-13.2), float(0.6), float(51.3), float(-0.195405), float(-0.980722), 4)
objSvc.createChildObject(object, 'object/creature/npc/theme_park/shared_player_transport.iff', 0, 0, 0, 1, 0)
objSvc.createChildObject(object, 'object/tangible/travel/ticket_collector/shared_ticket_collector.iff', 10, 0, -10, 0.707107, 0.707107)
core.mapService.addLocation(object.getPlanet(), 'Starport', object.getPosition().x, object.getPosition().z, 15, 0, 0)
-68
View File
@@ -1,68 +0,0 @@
/*******************************************************************************
* Copyright (c) 2013 <Project SWG>
*
* This File is part of NGECore2.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Using NGEngine to work with NGECore2 is making a combined work based on NGEngine.
* Therefore all terms and conditions of the GNU Lesser General Public License cover the combination.
******************************************************************************/
package resources.objects;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import org.python.google.common.collect.ArrayListMultimap;
import org.python.google.common.collect.Multimap;
import com.sleepycat.persist.model.Persistent;
import com.sleepycat.persist.model.PersistentProxy;
@Persistent(proxyFor=Multimap.class)
public class MultimapProxy<K, V> implements PersistentProxy<Multimap<K, V>> {
private int size = 0;
private K[] keys;
private V[] values;
private MultimapProxy() { }
public void initializeProxy(Multimap<K, V> object) {
List<K> keyList = new ArrayList<K>();
List<V> valueList = new ArrayList<V>();
for (Entry<K, V> entry : object.entries()) {
keyList.add(entry.getKey());
valueList.add(entry.getValue());
}
size = object.entries().size();
keys = keyList.toArray(keys);
values = valueList.toArray(values);
}
public Multimap<K, V> convertProxy() {
Multimap<K, V> map = ArrayListMultimap.create();
for (int i = 0; i < size; i++) {
map.put(keys[i], values[i]);
}
return map;
}
}
+46 -12
View File
@@ -28,6 +28,7 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;
import main.NGECore;
@@ -66,6 +67,7 @@ import protocol.swg.objectControllerObjects.DataTransform;
import protocol.swg.objectControllerObjects.DataTransformWithParent;
import protocol.swg.objectControllerObjects.TargetUpdate;
import resources.objects.building.BuildingObject;
import resources.objects.cell.CellObject;
import resources.objects.creature.CreatureObject;
import resources.objects.player.PlayerObject;
@@ -175,23 +177,46 @@ public class SimulationService implements INetworkDispatch {
public boolean add(SWGObject object, float x, float y, boolean notifyObservers) {
object.setIsInQuadtree(true);
core.objectService.loadServerTemplate(object);
boolean success = quadTrees.get(object.getPlanet().getName()).put(x, y, object);
if(success && notifyObservers) {
Point3D pos = new Point3D(x, 0, y);
Collection<SWGObject> newAwareObjects = get(object.getPlanet(), x, y, 512);
for(Iterator<SWGObject> it = newAwareObjects.iterator(); it.hasNext();) {
SWGObject obj = it.next();
if(obj.getAttachment("bigSpawnRange") == null && obj.getWorldPosition().getDistance(pos) > 200)
continue;
if(object.getClient() != null)
object.makeAware(obj);
if(obj.getClient() != null)
obj.makeAware(object);
if(success) {
Vector<SWGObject> childObjects = (Vector<SWGObject>) object.getAttachment("childObjects");
if(childObjects != null) {
addChildObjects(object, childObjects);
object.setAttachment("childObjects", null);
}
if(notifyObservers) {
Point3D pos = new Point3D(x, 0, y);
Collection<SWGObject> newAwareObjects = get(object.getPlanet(), x, y, 512);
for(Iterator<SWGObject> it = newAwareObjects.iterator(); it.hasNext();) {
SWGObject obj = it.next();
if(obj.getAttachment("bigSpawnRange") == null && obj.getWorldPosition().getDistance(pos) > 200)
continue;
if(object.getClient() != null)
object.makeAware(obj);
if(obj.getClient() != null)
obj.makeAware(object);
}
}
}
return success;
}
public void addChildObjects(SWGObject object, Vector<SWGObject> childObjects) {
for(SWGObject childObject : childObjects) {
if(childObject.getAttachment("cellNumber") == null)
add(childObject, childObject.getWorldPosition().x, childObject.getWorldPosition().z, true);
else {
BuildingObject building = (BuildingObject) object;
CellObject cell = building.getCellByCellNumber((Integer) childObject.getAttachment("cellNumber"));
if(cell == null)
continue;
cell.add(childObject);
}
}
}
public boolean move(SWGObject object, int oldX, int oldY, int newX, int newY) {
if(quadTrees.get(object.getPlanet().getName()).remove(oldX, oldY, object)) {
@@ -419,7 +444,16 @@ public class SimulationService implements INetworkDispatch {
}
});
objControllerOpcodes.put(ObjControllerOpcodes.HOVER_TARGET, new INetworkRemoteEvent() {
@Override
public void handlePacket(IoSession session, IoBuffer data) throws Exception {
}
});
}
@Override
+6 -5
View File
@@ -54,12 +54,13 @@ public class FactionService implements INetworkDispatch {
this.core = core;
try {
/* Temporarily commented until another commit
StfTable stf = new StfTable("string/en/faction/faction_names.stf");
/*
StfTable stf = new StfTable("clientdata/string/en/faction/faction_names.stf");
for (int s = 1; s < strings.length; s++) {
if (strings[0] != null) {
String faction = ((String) strings[s][0]);
for (int s = 1; s < stf.getRowCount(); s++) {
String faction = stf.getStringById(s).getKey();
if (faction != null && faction != "") {
factionMap.put(faction, CRC.StringtoCRC(faction));
}
}
+31 -14
View File
@@ -33,6 +33,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@@ -643,29 +644,45 @@ public class ObjectService implements INetworkDispatch {
* @param position The position as an offset to the parent object.
* @param orientation The orientation as an offset to the parent object.
*/
public void createChildObject(SWGObject parent, String template, Point3D position, Quaternion orientation) {
public void createChildObject(SWGObject parent, String template, Point3D position, Quaternion orientation, int cellNumber) {
if(cellNumber == -1) {
float radians = parent.getRadians();
Point3D parentPos = parent.getWorldPosition();
float radians = parent.getRadians();
Point3D parentPos = parent.getWorldPosition();
float x = (float) ((Math.cos(radians) * position.x) + (Math.sin(radians) * position.z));
float y = position.y + parentPos.y;
float z = (float) ((Math.cos(radians) * position.z) - (Math.sin(radians) * position.x));
x += parentPos.x;
z += parentPos.z;
position = new Point3D(x, y, z);
orientation = MathUtilities.rotateQuaternion(orientation, radians, new Point3D(0, 1, 0));
}
float x = (float) ((Math.cos(radians) * position.x) + (Math.sin(radians) * position.z));
float y = position.y + parentPos.y;
float z = (float) ((Math.cos(radians) * position.z) - (Math.sin(radians) * position.x));
x += parentPos.x;
z += parentPos.z;
position = new Point3D(x, y, z);
orientation = MathUtilities.rotateQuaternion(orientation, radians, new Point3D(0, 1, 0));
SWGObject child = createObject(template, 0, parent.getPlanet(), position, orientation);
core.simulationService.add(child, x, z);
if(parent.getAttachment("childObjects") == null)
parent.setAttachment("childObjects", new Vector<SWGObject>());
((Vector<SWGObject>) parent.getAttachment("childObjects")).add(child);
if(cellNumber != -1)
child.setAttachment("cellNumber", cellNumber);
//core.simulationService.add(child, x, z);
}
public void createChildObject(SWGObject parent, String template, float x, float y, float z, float qy, float qw) {
createChildObject(parent, template, new Point3D(x, y, z), new Quaternion(qw, 0, qy, 0));
createChildObject(parent, template, new Point3D(x, y, z), new Quaternion(qw, 0, qy, 0), -1);
}
public void createChildObject(SWGObject parent, String template, float x, float y, float z, float qy, float qw, int cellNumber) {
createChildObject(parent, template, new Point3D(x, y, z), new Quaternion(qw, 0, qy, 0), cellNumber);
}
public void loadBuildoutObjects(Planet planet) throws InstantiationException, IllegalAccessException {