mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-07-08 06:30:56 -04:00
Editor matrix, icons, rotation, impl light
This commit is contained in:
@@ -46,6 +46,7 @@ void func_80280038(void) {
|
||||
Mat4 matrix;
|
||||
|
||||
ClearMatrixPools();
|
||||
Editor_ClearMatrix();
|
||||
|
||||
gMatrixObjectCount = 0;
|
||||
gMatrixEffectCount = 0;
|
||||
|
||||
@@ -452,6 +452,7 @@ void func_80281540(void) {
|
||||
|
||||
void podium_ceremony_loop(void) {
|
||||
ClearMatrixPools();
|
||||
Editor_ClearMatrix();
|
||||
gMatrixObjectCount = 0;
|
||||
D_802874FC = 0;
|
||||
update_camera_podium_ceremony();
|
||||
|
||||
@@ -34,6 +34,7 @@ struct FVector {
|
||||
return x * other.x + y * other.y + z * other.z;
|
||||
}
|
||||
|
||||
|
||||
FVector Cross(const FVector& other) const {
|
||||
return FVector(
|
||||
y * other.z - z * other.y,
|
||||
@@ -42,6 +43,10 @@ struct FVector {
|
||||
);
|
||||
}
|
||||
|
||||
float Magnitude() const {
|
||||
return std::sqrt(x * x + y * y + z * z);
|
||||
}
|
||||
|
||||
FVector Normalize() const {
|
||||
float len = std::sqrt(x * x + y * y + z * z);
|
||||
return FVector(
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "objects/Object.h"
|
||||
#include "port/Game.h"
|
||||
|
||||
#include "editor/GameObject.h"
|
||||
|
||||
extern "C" {
|
||||
#include "camera.h"
|
||||
#include "objects.h"
|
||||
@@ -117,9 +119,9 @@ AActor* World::AddActor(AActor* actor) {
|
||||
Actors.push_back(actor);
|
||||
|
||||
if (actor->Model != NULL) {
|
||||
gEditor.AddObject(actor->Name, (FVector*) &actor->Pos, (Gfx*)LOAD_ASSET_RAW(actor->Model), 1.0f, CollisionType::VTX_INTERSECT, 0.0f, (int32_t*)&actor->Type, 0);
|
||||
gEditor.AddObject(actor->Name, (FVector*) &actor->Pos, &actor->Rot, nullptr, (Gfx*)LOAD_ASSET_RAW(actor->Model), 1.0f, Editor::GameObject::CollisionType::VTX_INTERSECT, 0.0f, (int32_t*)&actor->Type, 0);
|
||||
} else {
|
||||
gEditor.AddObject(actor->Name, (FVector*) &actor->Pos, NULL, 1.0f, CollisionType::VTX_INTERSECT, 0.0f, (int32_t*)&actor->Type, 0);
|
||||
gEditor.AddObject(actor->Name, (FVector*) &actor->Pos, &actor->Rot, nullptr, nullptr, 1.0f, Editor::GameObject::CollisionType::VTX_INTERSECT, 0.0f, (int32_t*)&actor->Type, 0);
|
||||
}
|
||||
return Actors.back();
|
||||
}
|
||||
@@ -135,9 +137,9 @@ struct Actor* World::AddBaseActor() {
|
||||
|
||||
void World::AddEditorObject(Actor* actor, const char* name) {
|
||||
if (actor->model != NULL) {
|
||||
gEditor.AddObject(name, (FVector*) &actor->pos, (Gfx*)LOAD_ASSET_RAW(actor->model), 1.0f, CollisionType::VTX_INTERSECT, 0.0f, (int32_t*)&actor->type, 0);
|
||||
gEditor.AddObject(name, (FVector*) &actor->pos, &actor->rot, nullptr, (Gfx*)LOAD_ASSET_RAW(actor->model), 1.0f, Editor::GameObject::CollisionType::VTX_INTERSECT, 0.0f, (int32_t*)&actor->type, 0);
|
||||
} else {
|
||||
gEditor.AddObject(name, (FVector*) &actor->pos, NULL, 1.0f, CollisionType::VTX_INTERSECT, 0.0f, (int32_t*)&actor->type, 0);
|
||||
gEditor.AddObject(name, (FVector*) &actor->pos, &actor->rot, nullptr, nullptr, 1.0f, Editor::GameObject::CollisionType::VTX_INTERSECT, 0.0f, (int32_t*)&actor->type, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,9 +182,9 @@ OObject* World::AddObject(OObject* object) {
|
||||
Object* cObj = &gObjectList[object->_objectIndex];
|
||||
|
||||
if (cObj->model != NULL) {
|
||||
gEditor.AddObject(object->Name, (FVector*) &cObj->origin_pos[0], (Gfx*)LOAD_ASSET_RAW(cObj->model), 1.0f, CollisionType::VTX_INTERSECT, 0.0f, &object->_objectIndex, -1);
|
||||
gEditor.AddObject(object->Name, (FVector*) &cObj->origin_pos[0], (Vec3s*)&cObj->orientation, nullptr, (Gfx*)LOAD_ASSET_RAW(cObj->model), 1.0f, Editor::GameObject::CollisionType::VTX_INTERSECT, 0.0f, &object->_objectIndex, -1);
|
||||
} else {
|
||||
gEditor.AddObject(object->Name, (FVector*) &cObj->origin_pos[0], NULL, 1.0f, CollisionType::VTX_INTERSECT, 0.0f, &object->_objectIndex, -1);
|
||||
gEditor.AddObject(object->Name, (FVector*) &cObj->origin_pos[0], (Vec3s*)&cObj->orientation, nullptr, nullptr, 1.0f, Editor::GameObject::CollisionType::VTX_INTERSECT, 0.0f, &object->_objectIndex, -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-1
@@ -20,18 +20,22 @@
|
||||
#include "Actor.h"
|
||||
#include "particles/ParticleEmitter.h"
|
||||
|
||||
#include "editor/Editor.h"
|
||||
#include "editor/GameObject.h"
|
||||
|
||||
extern "C" {
|
||||
#include "camera.h"
|
||||
#include "objects.h"
|
||||
};
|
||||
|
||||
class OObject;
|
||||
class Cup; // <-- Forward declaration
|
||||
class OObject;
|
||||
class Course;
|
||||
class AVehicle;
|
||||
class OBombKart;
|
||||
class TrainCrossing;
|
||||
class OLakitu;
|
||||
class GameObject; // <-- Editor
|
||||
|
||||
class World {
|
||||
typedef struct {
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "Course.h"
|
||||
#include "MarioRaceway.h"
|
||||
#include "ChocoMountain.h"
|
||||
#include "port/Game.h"
|
||||
|
||||
extern "C" {
|
||||
#include "main.h"
|
||||
|
||||
@@ -1,105 +1,106 @@
|
||||
#include "Collision.h"
|
||||
|
||||
namespace Editor {
|
||||
void GenerateCollisionMesh(GameObject* object, Gfx* model, float scale) {
|
||||
int8_t opcode;
|
||||
uintptr_t lo;
|
||||
uintptr_t hi;
|
||||
|
||||
void GenerateCollisionMesh(GameObject& object, Gfx* model, float scale) {
|
||||
int8_t opcode;
|
||||
uintptr_t lo;
|
||||
uintptr_t hi;
|
||||
Gfx* ptr = model;
|
||||
Vtx* vtx = NULL;
|
||||
size_t i = 0;
|
||||
bool run = true;
|
||||
while (run) {
|
||||
i++;
|
||||
lo = ptr->words.w0;
|
||||
hi = ptr->words.w1;
|
||||
|
||||
Gfx* ptr = model;
|
||||
Vtx* vtx = NULL;
|
||||
size_t i = 0;
|
||||
bool run = true;
|
||||
while (run) {
|
||||
i++;
|
||||
lo = ptr->words.w0;
|
||||
hi = ptr->words.w1;
|
||||
opcode = (EDITOR_GFX_GET_OPCODE(lo) >> 24);
|
||||
|
||||
opcode = (EDITOR_GFX_GET_OPCODE(lo) >> 24);
|
||||
|
||||
switch(opcode) {
|
||||
case G_DL:
|
||||
GenerateCollisionMesh(object, (Gfx*)hi, scale);
|
||||
break;
|
||||
case G_DL_OTR_HASH:
|
||||
ptr++;
|
||||
GenerateCollisionMesh(object, (Gfx*)ResourceGetDataByCrc(((uint64_t)(ptr->words.w0 << 32)) + ptr->words.w1), scale);
|
||||
break;
|
||||
case G_VTX:
|
||||
vtx = (Vtx*)ptr->words.w1;
|
||||
break;
|
||||
case G_VTX_OTR_HASH: {
|
||||
const uintptr_t offset = hi;
|
||||
ptr++;
|
||||
vtx = (Vtx*)ResourceGetDataByCrc(((uint64_t)(ptr->words.w0 << 32)) + ptr->words.w1);
|
||||
break;
|
||||
}
|
||||
case G_TRI1: {
|
||||
if (vtx == NULL) {
|
||||
switch(opcode) {
|
||||
case G_DL:
|
||||
GenerateCollisionMesh(object, (Gfx*)hi, scale);
|
||||
break;
|
||||
case G_DL_OTR_HASH:
|
||||
ptr++;
|
||||
continue;
|
||||
}
|
||||
uint32_t v1 = ((hi & 0x00FF0000) >> 16) / 2;
|
||||
uint32_t v2 = ((hi & 0x0000FF00) >> 8) / 2;
|
||||
uint32_t v3 = (hi & 0x000000FF) / 2;
|
||||
|
||||
FVector p1 = FVector(vtx[v1].v.ob[0], vtx[v1].v.ob[1], vtx[v1].v.ob[2]);
|
||||
FVector p2 = FVector(vtx[v2].v.ob[0], vtx[v2].v.ob[1], vtx[v2].v.ob[2]);
|
||||
FVector p3 = FVector(vtx[v3].v.ob[0], vtx[v3].v.ob[1], vtx[v3].v.ob[2]);
|
||||
|
||||
object.Triangles.push_back({p1, p2, p3});
|
||||
break;
|
||||
}
|
||||
case G_TRI2: {
|
||||
if (vtx == NULL) {
|
||||
GenerateCollisionMesh(object, (Gfx*)ResourceGetDataByCrc(((uint64_t)(ptr->words.w0 << 32)) + ptr->words.w1), scale);
|
||||
break;
|
||||
case G_VTX:
|
||||
vtx = (Vtx*)ptr->words.w1;
|
||||
break;
|
||||
case G_VTX_OTR_HASH: {
|
||||
const uintptr_t offset = hi;
|
||||
ptr++;
|
||||
continue;
|
||||
vtx = (Vtx*)ResourceGetDataByCrc(((uint64_t)(ptr->words.w0 << 32)) + ptr->words.w1);
|
||||
break;
|
||||
}
|
||||
uint32_t v1 = ((lo & 0x00FF0000) >> 16) / 2;
|
||||
uint32_t v2 = ((lo & 0x0000FF00) >> 8) / 2;
|
||||
uint32_t v3 = (lo & 0x000000FF) / 2;
|
||||
case G_TRI1: {
|
||||
if (vtx == NULL) {
|
||||
ptr++;
|
||||
continue;
|
||||
}
|
||||
uint32_t v1 = ((hi & 0x00FF0000) >> 16) / 2;
|
||||
uint32_t v2 = ((hi & 0x0000FF00) >> 8) / 2;
|
||||
uint32_t v3 = (hi & 0x000000FF) / 2;
|
||||
|
||||
// This is actually triangle 2; vert 1,2,3.
|
||||
uint32_t v4 = ((hi & 0x00FF0000) >> 16) / 2;
|
||||
uint32_t v5 = ((hi & 0x0000FF00) >> 8) / 2;
|
||||
uint32_t v6 = (hi & 0x000000FF) / 2;
|
||||
FVector p1 = FVector(vtx[v1].v.ob[0], vtx[v1].v.ob[1], vtx[v1].v.ob[2]);
|
||||
FVector p2 = FVector(vtx[v2].v.ob[0], vtx[v2].v.ob[1], vtx[v2].v.ob[2]);
|
||||
FVector p3 = FVector(vtx[v3].v.ob[0], vtx[v3].v.ob[1], vtx[v3].v.ob[2]);
|
||||
|
||||
FVector p1 = FVector(vtx[v1].v.ob[0], vtx[v1].v.ob[1], vtx[v1].v.ob[2]);
|
||||
FVector p2 = FVector(vtx[v2].v.ob[0], vtx[v2].v.ob[1], vtx[v2].v.ob[2]);
|
||||
FVector p3 = FVector(vtx[v3].v.ob[0], vtx[v3].v.ob[1], vtx[v3].v.ob[2]);
|
||||
|
||||
FVector p4 = FVector(vtx[v4].v.ob[0], vtx[v4].v.ob[1], vtx[v4].v.ob[2]);
|
||||
FVector p5 = FVector(vtx[v5].v.ob[0], vtx[v5].v.ob[1], vtx[v5].v.ob[2]);
|
||||
FVector p6 = FVector(vtx[v6].v.ob[0], vtx[v6].v.ob[1], vtx[v6].v.ob[2]);
|
||||
|
||||
object.Triangles.push_back({p1, p2, p3});
|
||||
object.Triangles.push_back({p4, p5, p6});
|
||||
break;
|
||||
}
|
||||
case G_QUAD: {
|
||||
if (vtx == NULL) {
|
||||
ptr++;
|
||||
continue;
|
||||
object->Triangles.push_back({p1, p2, p3});
|
||||
break;
|
||||
}
|
||||
uint32_t v1 = ((hi & 0x00FF0000) >> 16) / 2;
|
||||
uint32_t v2 = ((hi & 0x0000FF00) >> 8) / 2;
|
||||
uint32_t v3 = (hi & 0x000000FF) / 2;
|
||||
uint32_t v4 = ((hi & 0xFF000000) >> 24) / 2;
|
||||
case G_TRI2: {
|
||||
if (vtx == NULL) {
|
||||
ptr++;
|
||||
continue;
|
||||
}
|
||||
uint32_t v1 = ((lo & 0x00FF0000) >> 16) / 2;
|
||||
uint32_t v2 = ((lo & 0x0000FF00) >> 8) / 2;
|
||||
uint32_t v3 = (lo & 0x000000FF) / 2;
|
||||
|
||||
FVector p1 = FVector(vtx[v1].v.ob[0], vtx[v1].v.ob[1], vtx[v1].v.ob[2]);
|
||||
FVector p2 = FVector(vtx[v2].v.ob[0], vtx[v2].v.ob[1], vtx[v2].v.ob[2]);
|
||||
FVector p3 = FVector(vtx[v3].v.ob[0], vtx[v3].v.ob[1], vtx[v3].v.ob[2]);
|
||||
FVector p4 = FVector(vtx[v4].v.ob[0], vtx[v4].v.ob[1], vtx[v4].v.ob[2]);
|
||||
// This is actually triangle 2; vert 1,2,3.
|
||||
uint32_t v4 = ((hi & 0x00FF0000) >> 16) / 2;
|
||||
uint32_t v5 = ((hi & 0x0000FF00) >> 8) / 2;
|
||||
uint32_t v6 = (hi & 0x000000FF) / 2;
|
||||
|
||||
object.Triangles.push_back({p1, p2, p3});
|
||||
object.Triangles.push_back({p1, p3, p4});
|
||||
break;
|
||||
FVector p1 = FVector(vtx[v1].v.ob[0], vtx[v1].v.ob[1], vtx[v1].v.ob[2]);
|
||||
FVector p2 = FVector(vtx[v2].v.ob[0], vtx[v2].v.ob[1], vtx[v2].v.ob[2]);
|
||||
FVector p3 = FVector(vtx[v3].v.ob[0], vtx[v3].v.ob[1], vtx[v3].v.ob[2]);
|
||||
|
||||
FVector p4 = FVector(vtx[v4].v.ob[0], vtx[v4].v.ob[1], vtx[v4].v.ob[2]);
|
||||
FVector p5 = FVector(vtx[v5].v.ob[0], vtx[v5].v.ob[1], vtx[v5].v.ob[2]);
|
||||
FVector p6 = FVector(vtx[v6].v.ob[0], vtx[v6].v.ob[1], vtx[v6].v.ob[2]);
|
||||
|
||||
object->Triangles.push_back({p1, p2, p3});
|
||||
object->Triangles.push_back({p4, p5, p6});
|
||||
break;
|
||||
}
|
||||
case G_QUAD: {
|
||||
if (vtx == NULL) {
|
||||
ptr++;
|
||||
continue;
|
||||
}
|
||||
uint32_t v1 = ((hi & 0x00FF0000) >> 16) / 2;
|
||||
uint32_t v2 = ((hi & 0x0000FF00) >> 8) / 2;
|
||||
uint32_t v3 = (hi & 0x000000FF) / 2;
|
||||
uint32_t v4 = ((hi & 0xFF000000) >> 24) / 2;
|
||||
|
||||
FVector p1 = FVector(vtx[v1].v.ob[0], vtx[v1].v.ob[1], vtx[v1].v.ob[2]);
|
||||
FVector p2 = FVector(vtx[v2].v.ob[0], vtx[v2].v.ob[1], vtx[v2].v.ob[2]);
|
||||
FVector p3 = FVector(vtx[v3].v.ob[0], vtx[v3].v.ob[1], vtx[v3].v.ob[2]);
|
||||
FVector p4 = FVector(vtx[v4].v.ob[0], vtx[v4].v.ob[1], vtx[v4].v.ob[2]);
|
||||
|
||||
object->Triangles.push_back({p1, p2, p3});
|
||||
object->Triangles.push_back({p1, p3, p4});
|
||||
break;
|
||||
}
|
||||
case G_ENDDL:
|
||||
run = false;
|
||||
break;
|
||||
}
|
||||
case G_ENDDL:
|
||||
run = false;
|
||||
break;
|
||||
|
||||
ptr++;
|
||||
}
|
||||
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <libultraship.h>
|
||||
#include <libultra/gbi.h>
|
||||
#include "GameObject.h"
|
||||
|
||||
#include "EditorMath.h"
|
||||
|
||||
@@ -16,4 +17,6 @@
|
||||
|
||||
#define EDITOR_GFX_GET_OPCODE(var) ((uint32_t) ((var) & 0xFF000000))
|
||||
|
||||
void GenerateCollisionMesh(GameObject& object, Gfx* model, float scale);
|
||||
namespace Editor {
|
||||
void GenerateCollisionMesh(GameObject* object, Gfx* model, float scale);
|
||||
}
|
||||
+102
-84
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "Editor.h"
|
||||
#include "Collision.h"
|
||||
#include "Light.h"
|
||||
|
||||
#include "port/Engine.h"
|
||||
#include <controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h>
|
||||
@@ -22,101 +23,118 @@ extern "C" {
|
||||
#include "camera.h"
|
||||
}
|
||||
|
||||
namespace EditorNamespace {
|
||||
namespace Editor {
|
||||
int gfx_create_framebuffer(uint32_t width, uint32_t height, uint32_t native_width, uint32_t native_height,
|
||||
uint8_t resize);
|
||||
|
||||
int gfx_create_framebuffer(uint32_t width, uint32_t height, uint32_t native_width, uint32_t native_height,
|
||||
uint8_t resize);
|
||||
|
||||
Editor::Editor() {
|
||||
}
|
||||
|
||||
void Editor::Load() {
|
||||
printf("Editor: Loading Editor...\n");
|
||||
eObjectPicker.Load();;
|
||||
for (auto& object : eGameObjects) {
|
||||
GenerateCollisionMesh(object, object.Model, 1.0f);
|
||||
}
|
||||
printf("Editor: Loading Complete!\n");
|
||||
}
|
||||
|
||||
void Editor::Tick() {
|
||||
auto wnd = GameEngine::Instance->context->GetWindow();
|
||||
|
||||
static bool wasMouseDown = false;
|
||||
static bool isDragging = false;
|
||||
static Ship::Coords mouseStartPos;
|
||||
|
||||
Ship::Coords mousePos = wnd->GetMousePos();
|
||||
bool isMouseDown = wnd->GetMouseState(Ship::LUS_MOUSE_BTN_LEFT);
|
||||
|
||||
eGameObjects.erase(
|
||||
std::remove_if(eGameObjects.begin(), eGameObjects.end(),
|
||||
[](const auto& object) { return (*object.DespawnFlag) == object.DespawnValue; printf("DELETED OBJ\n"); }),
|
||||
eGameObjects.end());
|
||||
|
||||
if (isMouseDown && !wasMouseDown) {
|
||||
// Mouse just pressed (Pressed state)
|
||||
mouseStartPos = mousePos;
|
||||
isDragging = false;
|
||||
Editor::Editor() {
|
||||
}
|
||||
|
||||
if (isMouseDown) {
|
||||
// Mouse is being held (Held state)
|
||||
int dx = mousePos.x - mouseStartPos.x;
|
||||
int dy = mousePos.y - mouseStartPos.y;
|
||||
int dragThreshold = 5; // Adjust as needed
|
||||
void Editor::Load() {
|
||||
printf("Editor: Loading Editor...\n");
|
||||
eObjectPicker.Load();;
|
||||
for (auto& object : eGameObjects) {
|
||||
GenerateCollisionMesh(object, object->Model, 1.0f);
|
||||
object->Load();
|
||||
}
|
||||
printf("Editor: Loading Complete!\n");
|
||||
}
|
||||
|
||||
if ((dx * dx + dy * dy) > (dragThreshold * dragThreshold)) {
|
||||
// Squared distance check to avoid unnecessary sqrt()
|
||||
isDragging = true;
|
||||
eObjectPicker.DragHandle(); // Call drag logic
|
||||
void Editor::Tick() {
|
||||
auto wnd = GameEngine::Instance->context->GetWindow();
|
||||
|
||||
static bool wasMouseDown = false;
|
||||
static bool isDragging = false;
|
||||
static Ship::Coords mouseStartPos;
|
||||
|
||||
Ship::Coords mousePos = wnd->GetMousePos();
|
||||
bool isMouseDown = wnd->GetMouseState(Ship::LUS_MOUSE_BTN_LEFT);
|
||||
|
||||
eGameObjects.erase(
|
||||
std::remove_if(eGameObjects.begin(), eGameObjects.end(),
|
||||
[](const auto& object) { return (*object->DespawnFlag) == object->DespawnValue; printf("DELETED OBJ\n"); }),
|
||||
eGameObjects.end());
|
||||
|
||||
if (isMouseDown && !wasMouseDown) {
|
||||
// Mouse just pressed (Pressed state)
|
||||
mouseStartPos = mousePos;
|
||||
isDragging = false;
|
||||
}
|
||||
|
||||
if (isMouseDown) {
|
||||
// Mouse is being held (Held state)
|
||||
int dx = mousePos.x - mouseStartPos.x;
|
||||
int dy = mousePos.y - mouseStartPos.y;
|
||||
int dragThreshold = 5; // Adjust as needed
|
||||
|
||||
if ((dx * dx + dy * dy) > (dragThreshold * dragThreshold)) {
|
||||
// Squared distance check to avoid unnecessary sqrt()
|
||||
isDragging = true;
|
||||
eObjectPicker.DragHandle(); // Call drag logic
|
||||
}
|
||||
}
|
||||
|
||||
if (!isMouseDown && wasMouseDown) {
|
||||
// Mouse just released (Released state)
|
||||
eObjectPicker.eGizmo.SelectedHandle = Gizmo::GizmoHandle::None;
|
||||
if (!isDragging) {
|
||||
eObjectPicker.SelectObject(eGameObjects);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
wasMouseDown = isMouseDown; // Update previous state
|
||||
|
||||
eObjectPicker.Tick();
|
||||
|
||||
for (auto& object : eGameObjects) {
|
||||
object->Tick();
|
||||
}
|
||||
}
|
||||
|
||||
if (!isMouseDown && wasMouseDown) {
|
||||
// Mouse just released (Released state)
|
||||
eObjectPicker.eGizmo.SelectedHandle = Gizmo::GizmoHandle::None;
|
||||
if (!isDragging) {
|
||||
eObjectPicker.SelectObject(eGameObjects);
|
||||
void Editor::Draw() {
|
||||
eObjectPicker.Draw();
|
||||
for (auto& object : eGameObjects) {
|
||||
object->Draw();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
wasMouseDown = isMouseDown; // Update previous state
|
||||
void Editor::AddObject(const char* name, FVector* pos, Vec3s* rot, FVector* scale, Gfx* model, float collScale, GameObject::CollisionType collision, float boundingBoxSize, int32_t* despawnFlag, int32_t despawnValue) {
|
||||
if (model != NULL) {
|
||||
eGameObjects.push_back(new GameObject(name, pos, rot, scale, model, {}, collision, boundingBoxSize, despawnFlag, despawnValue));
|
||||
GenerateCollisionMesh(eGameObjects.back(), model, collScale);
|
||||
} else { // to bounding box or sphere collision
|
||||
eGameObjects.push_back(new GameObject(name, pos, rot, scale, model, {}, GameObject::CollisionType::BOUNDING_BOX,
|
||||
22.0f, despawnFlag, despawnValue));
|
||||
}
|
||||
}
|
||||
|
||||
eObjectPicker.Tick();
|
||||
}
|
||||
|
||||
void Editor::Draw() {
|
||||
eObjectPicker.Draw();
|
||||
}
|
||||
void Editor::AddLight(const char* name, FVector* pos, s8* rot) {
|
||||
eGameObjects.push_back(new LightObject(name, pos, rot));
|
||||
}
|
||||
|
||||
void Editor::AddObject(const char* name, FVector* pos, Gfx* model, float scale, CollisionType collision, float boundingBoxSize, int32_t* despawnFlag, int32_t despawnValue) {
|
||||
if (model != NULL) {
|
||||
eGameObjects.push_back({name, pos, model, {}, collision, boundingBoxSize, despawnFlag, despawnValue});
|
||||
GenerateCollisionMesh(eGameObjects.back(), model, scale);
|
||||
} else { // to bounding box or sphere collision
|
||||
eGameObjects.push_back({name, pos, model, {}, CollisionType::BOUNDING_BOX, 22.0f, despawnFlag, despawnValue});
|
||||
void Editor::ClearObjects() {
|
||||
for (auto& obj : eGameObjects) {
|
||||
delete obj;
|
||||
}
|
||||
}
|
||||
|
||||
void Editor::ClearMatrixPool() {
|
||||
EditorMatrix.clear();
|
||||
}
|
||||
|
||||
void Editor::SelectObjectFromSceneExplorer(GameObject* object) {
|
||||
eObjectPicker._selected = object;
|
||||
eObjectPicker.eGizmo.Enabled = true;
|
||||
eObjectPicker.eGizmo.SetGizmoNoCursor(object);
|
||||
}
|
||||
|
||||
void Editor::SetLevelDimensions(s16 minX, s16 maxX, s16 minZ, s16 maxZ, s16 minY, s16 maxY) {
|
||||
eObjectPicker.eGizmo.dimensions.MinX = minX + -1000;
|
||||
eObjectPicker.eGizmo.dimensions.MaxX = maxX + 1000;
|
||||
eObjectPicker.eGizmo.dimensions.MinY = minY + -100;
|
||||
eObjectPicker.eGizmo.dimensions.MaxY = maxY + 500;
|
||||
eObjectPicker.eGizmo.dimensions.MinZ = minZ + -1000;
|
||||
eObjectPicker.eGizmo.dimensions.MaxZ = maxZ + 1000;
|
||||
}
|
||||
}
|
||||
|
||||
void Editor::ClearObjects() {
|
||||
eGameObjects.clear();
|
||||
}
|
||||
|
||||
void Editor::SelectObjectFromSceneExplorer(GameObject* object) {
|
||||
eObjectPicker._selected = object;
|
||||
eObjectPicker.eGizmo.Enabled = true;
|
||||
eObjectPicker.eGizmo.SetGizmoNoCursor(object);
|
||||
}
|
||||
|
||||
void Editor::SetLevelDimensions(s16 minX, s16 maxX, s16 minZ, s16 maxZ, s16 minY, s16 maxY) {
|
||||
eObjectPicker.eGizmo.dimensions.MinX = minX + -1000;
|
||||
eObjectPicker.eGizmo.dimensions.MaxX = maxX + 1000;
|
||||
eObjectPicker.eGizmo.dimensions.MinY = minY + -100;
|
||||
eObjectPicker.eGizmo.dimensions.MaxY = maxY + 500;
|
||||
eObjectPicker.eGizmo.dimensions.MinZ = minZ + -1000;
|
||||
eObjectPicker.eGizmo.dimensions.MaxZ = maxZ + 1000;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,30 +3,32 @@
|
||||
|
||||
#include <libultraship.h>
|
||||
#include <libultra/gbi.h>
|
||||
#include "GameObject.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "ObjectPicker.h"
|
||||
namespace EditorNamespace {
|
||||
namespace Editor {
|
||||
class ObjectPicker;
|
||||
|
||||
class Editor {
|
||||
public:
|
||||
Editor();
|
||||
|
||||
|
||||
ObjectPicker eObjectPicker;
|
||||
std::vector<GameObject> eGameObjects;
|
||||
std::vector<GameObject*> eGameObjects;
|
||||
|
||||
void Tick();
|
||||
void Draw();
|
||||
void MouseClick();
|
||||
void Load();
|
||||
void AddObject(const char* name, FVector* pos, Gfx* model, float scale, CollisionType collision, float boundingBoxSize, int32_t* despawnFlag, int32_t despawnValue);
|
||||
void AddObject(const char* name, FVector* pos, Vec3s* rot, FVector* scale, Gfx* model, float collScale, GameObject::CollisionType collision, float boundingBoxSize, int32_t* despawnFlag, int32_t despawnValue);
|
||||
void AddLight(const char* name, FVector* pos, s8* rot);
|
||||
void ClearObjects();
|
||||
void RemoveObject();
|
||||
void SelectObjectFromSceneExplorer(GameObject* object);
|
||||
void SetLevelDimensions(s16 minX, s16 maxX, s16 minZ, s16 maxZ, s16 minY, s16 maxY);
|
||||
void ClearMatrixPool();
|
||||
|
||||
private:
|
||||
bool _draw = false;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include <libultraship.h>
|
||||
#include "port/Game.h"
|
||||
#include "port/Engine.h"
|
||||
#include <libultra/types.h>
|
||||
#include "GameObject.h"
|
||||
|
||||
#include <vector>
|
||||
#include <limits>
|
||||
@@ -18,6 +20,8 @@ extern "C" {
|
||||
#include "camera.h"
|
||||
}
|
||||
|
||||
std::vector<Mtx> EditorMatrix;
|
||||
|
||||
bool IsInGameScreen() {
|
||||
auto wnd = GameEngine::Instance->context->GetWindow();
|
||||
Ship::Coords mouse = wnd->GetMousePos();
|
||||
@@ -278,26 +282,60 @@ bool IntersectRaySphere(const Ray& ray, const FVector& sphereCenter, float radiu
|
||||
return false; // Sphere is behind the ray origin
|
||||
}
|
||||
|
||||
// bool FindClosestObject(const Ray& ray, const std::vector<GameObject*>& objects, GameObject* outObject, float& outDistance) {
|
||||
// float closestDist = std::numeric_limits<float>::max();
|
||||
// bool found = false;
|
||||
|
||||
bool FindClosestObject(const Ray& ray, const std::vector<GameObject>& objects, GameObject& outObject, float& outDistance) {
|
||||
float closestDist = std::numeric_limits<float>::max();
|
||||
bool found = false;
|
||||
// for (const auto& obj : objects) {
|
||||
// for (const auto& tri : obj.Triangles) {
|
||||
// float t;
|
||||
// if (IntersectRayTriangle(ray, tri, *obj.Pos, t) && t < closestDist) {
|
||||
// closestDist = t;
|
||||
// outObject = obj;
|
||||
// found = true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
for (const auto& obj : objects) {
|
||||
for (const auto& tri : obj.Triangles) {
|
||||
float t;
|
||||
if (IntersectRayTriangle(ray, tri, *obj.Pos, t) && t < closestDist) {
|
||||
closestDist = t;
|
||||
outObject = obj;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
outDistance = closestDist;
|
||||
return true;
|
||||
}
|
||||
// if (found) {
|
||||
// outDistance = closestDist;
|
||||
// return true;
|
||||
// }
|
||||
|
||||
return false;
|
||||
// return false;
|
||||
// }
|
||||
|
||||
void Editor_AddMatrix(Mat4 mtx, int32_t flags) {
|
||||
EditorMatrix.emplace_back();
|
||||
guMtxF2L(mtx, &EditorMatrix.back());
|
||||
gSPMatrix(gDisplayListHead++, &EditorMatrix.back(), flags);
|
||||
}
|
||||
|
||||
float CalculateAngle(const FVector& start, const FVector& end) {
|
||||
float dot = start.Dot(end);
|
||||
|
||||
float magStart = start.Magnitude();
|
||||
float magEnd = end.Magnitude();
|
||||
|
||||
float cosAngle = dot / (magStart * magEnd);
|
||||
cosAngle = std::min(1.0f, std::max(-1.0f, cosAngle));
|
||||
|
||||
return acos(cosAngle);
|
||||
}
|
||||
|
||||
void SetDirectionFromRotator(s16 rotator[3], s8 direction[3]) {
|
||||
float yaw = rotator[1] * (M_PI / 32768.0f); // Convert from s16 (0 to 32767) to radians
|
||||
float pitch = rotator[0] * (M_PI / 32768.0f);
|
||||
|
||||
// Compute unit direction vector
|
||||
float x = cosf(yaw) * cosf(pitch);
|
||||
float y = -sinf(pitch);
|
||||
float z = -sinf(yaw) * cosf(pitch);
|
||||
|
||||
// Scale into -127 to 127 range (not 128 to avoid overflow)
|
||||
direction[0] = static_cast<s8>(x * 127.0f);
|
||||
direction[1] = static_cast<s8>(y * 127.0f);
|
||||
direction[2] = static_cast<s8>(z * 127.0f);
|
||||
|
||||
printf("Light dir %d %d %d (from rot 0x%X 0x%X 0x%X)\n", direction[0], direction[1], direction[2], rotator[0], rotator[1], rotator[2]);
|
||||
}
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include <libultra/gbi.h>
|
||||
#include <libultra/types.h>
|
||||
#include "../CoreMath.h"
|
||||
#include <vector>
|
||||
#include "GameObject.h"
|
||||
|
||||
extern "C" {
|
||||
#include "common_structs.h"
|
||||
}
|
||||
|
||||
std::vector<Mtx> EditorMatrix;
|
||||
|
||||
enum class CollisionType {
|
||||
VTX_INTERSECT,
|
||||
BOUNDING_BOX,
|
||||
BOUNDING_SPHERE
|
||||
};
|
||||
extern std::vector<Mtx> EditorMatrix;
|
||||
|
||||
struct Ray {
|
||||
FVector Origin;
|
||||
@@ -24,17 +22,6 @@ struct Triangle {
|
||||
FVector v0, v1, v2;
|
||||
};
|
||||
|
||||
struct GameObject {
|
||||
const char* Name;
|
||||
FVector* Pos;
|
||||
Gfx* Model;
|
||||
std::vector<Triangle> Triangles;
|
||||
CollisionType Collision;
|
||||
float BoundingBoxSize;
|
||||
int32_t* DespawnFlag;
|
||||
int32_t DespawnValue;
|
||||
};
|
||||
|
||||
/**
|
||||
* Projects 2D cursor into the game world
|
||||
*
|
||||
@@ -55,5 +42,6 @@ void Clear(MtxF* mf);
|
||||
bool IntersectRayTriangle(const Ray& ray, const Triangle& tri, const FVector& objectPos, float& t);
|
||||
bool IntersectRaySphere(const Ray& ray, const FVector& sphereCenter, float radius, float& t);
|
||||
|
||||
|
||||
|
||||
void Editor_AddMatrix(Mat4 mtx, int32_t flags);
|
||||
float CalculateAngle(const FVector& start, const FVector& end);
|
||||
void SetDirectionFromRotator(s16 rotator[3], s8 direction[3]);
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
#include <libultraship.h>
|
||||
#include "GameObject.h"
|
||||
|
||||
namespace Editor {
|
||||
|
||||
GameObject::GameObject(const char* name, FVector* pos, Vec3s* rot, FVector* scale, Gfx* model, std::vector<Triangle> triangles, CollisionType collision, float boundingBoxSize, int32_t* despawnFlag, int32_t despawnValue) {
|
||||
Name = name;
|
||||
Pos = pos;
|
||||
Rot = rot;
|
||||
Scale = scale;
|
||||
Model = model;
|
||||
Triangles = triangles;
|
||||
Collision = collision;
|
||||
BoundingBoxSize = boundingBoxSize;
|
||||
DespawnFlag = despawnFlag;
|
||||
DespawnValue = despawnValue;
|
||||
}
|
||||
|
||||
GameObject::GameObject(FVector* pos, Vec3s* rot) {
|
||||
//Pos = pos;
|
||||
//Rot = rot;
|
||||
}
|
||||
|
||||
GameObject::GameObject() {};
|
||||
|
||||
void GameObject::Draw(){};
|
||||
|
||||
void GameObject::Tick(){};
|
||||
|
||||
} // namespace Editor
|
||||
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include <libultra/gbi.h>
|
||||
#include <libultra/types.h>
|
||||
#include "../CoreMath.h"
|
||||
#include "EditorMath.h"
|
||||
#include <vector>
|
||||
|
||||
extern "C" {
|
||||
#include "common_structs.h"
|
||||
}
|
||||
|
||||
struct Triangle;
|
||||
|
||||
namespace Editor {
|
||||
class GameObject {
|
||||
public:
|
||||
enum class CollisionType {
|
||||
VTX_INTERSECT,
|
||||
BOUNDING_BOX,
|
||||
BOUNDING_SPHERE
|
||||
};
|
||||
|
||||
GameObject(const char* name, FVector* pos, Vec3s* rot, FVector* scale, Gfx* model, std::vector<Triangle> triangles, CollisionType collision, float boundingBoxSize, int32_t* despawnFlag, int32_t despawnValue);
|
||||
GameObject(FVector* pos, Vec3s* rot);
|
||||
GameObject();
|
||||
virtual void Tick();
|
||||
virtual void Draw();
|
||||
virtual void Load() {};
|
||||
|
||||
const char* Name;
|
||||
FVector* Pos;
|
||||
Vec3s* Rot;
|
||||
FVector* Scale;
|
||||
Gfx* Model;
|
||||
std::vector<Triangle> Triangles;
|
||||
CollisionType Collision;
|
||||
float BoundingBoxSize;
|
||||
int32_t* DespawnFlag;
|
||||
int32_t DespawnValue;
|
||||
|
||||
};
|
||||
}
|
||||
+77
-24
@@ -4,6 +4,7 @@
|
||||
#include <libultra/types.h>
|
||||
#include "../World.h"
|
||||
|
||||
#include "EditorMath.h"
|
||||
#include "Gizmo.h"
|
||||
#include "port/Engine.h"
|
||||
#include <controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h>
|
||||
@@ -11,6 +12,7 @@
|
||||
|
||||
#include "engine/actors/Ship.h"
|
||||
#include "port/Game.h"
|
||||
#include "Handle.h"
|
||||
|
||||
extern "C" {
|
||||
#include "common_structs.h"
|
||||
@@ -24,10 +26,7 @@ extern "C" {
|
||||
#include "src/racing/collision.h"
|
||||
}
|
||||
|
||||
namespace EditorNamespace {
|
||||
|
||||
Gizmo::Gizmo() {
|
||||
}
|
||||
namespace Editor {
|
||||
|
||||
void Gizmo::Load() {
|
||||
RedCollision.Pos = &Pos;
|
||||
@@ -39,14 +38,25 @@ void Gizmo::Load() {
|
||||
BlueCollision.Pos = &Pos;
|
||||
BlueCollision.Model = handle_Cylinder_mesh;
|
||||
|
||||
GenerateCollisionMesh(RedCollision, RedCollision.Model, 0.05f);
|
||||
GenerateCollisionMesh(GreenCollision, GreenCollision.Model, 0.05f);
|
||||
GenerateCollisionMesh(BlueCollision, BlueCollision.Model, 0.05f);
|
||||
GenerateCollisionMesh(&RedCollision, RedCollision.Model, 0.05f);
|
||||
GenerateCollisionMesh(&GreenCollision, GreenCollision.Model, 0.05f);
|
||||
GenerateCollisionMesh(&BlueCollision, BlueCollision.Model, 0.05f);
|
||||
}
|
||||
|
||||
void Gizmo::Tick() {
|
||||
if (Enabled) {
|
||||
Gizmo::Translate();
|
||||
TranslationMode mode = static_cast<TranslationMode>(CVarGetInteger("eGizmoMode", 0));
|
||||
switch(mode) {
|
||||
case TranslationMode::Move:
|
||||
Gizmo::Translate();
|
||||
break;
|
||||
case TranslationMode::Rotate:
|
||||
Gizmo::Rotate();
|
||||
break;
|
||||
case TranslationMode::Scale:
|
||||
Gizmo::Scale();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,13 +151,50 @@ f32 Gizmo::SnapToSurface(FVector* pos) {
|
||||
return y;
|
||||
}
|
||||
|
||||
// void Gizmo::Rotate() {
|
||||
void Gizmo::Rotate() {
|
||||
float length = 180.0f;
|
||||
float sensitivity = 0.2f;
|
||||
|
||||
// }
|
||||
if (_selected->Rot == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
// void Gizmo::Scale() {
|
||||
|
||||
// }
|
||||
length = sqrt(
|
||||
pow(_selected->Pos->x - cameras[0].pos[0], 2) +
|
||||
pow(_selected->Pos->y - cameras[0].pos[1], 2) +
|
||||
pow(_selected->Pos->z - cameras[0].pos[2], 2)
|
||||
);
|
||||
|
||||
FVector cameraPos = {
|
||||
cameras[0].pos[0] + _ray.x * length,
|
||||
cameras[0].pos[1] + _ray.y * length,
|
||||
cameras[0].pos[2] + _ray.z * length,
|
||||
};
|
||||
|
||||
float angle = CalculateAngle(_cursorOffset, cameraPos) * 100;
|
||||
|
||||
// printf("start %f %f %f end %f %f %f angle %f\n", _cursorOffset.x, _cursorOffset.y, _cursorOffset.z, cameraPos.x, cameraPos.y, cameraPos.z, angle);
|
||||
// Depending on which axis or handle you want to rotate, apply rotation.
|
||||
switch(SelectedHandle) {
|
||||
case GizmoHandle::All_Axis:
|
||||
(*_selected->Rot)[0] = static_cast<short>((s16)((*_selected->Rot)[0] + angle) & 0xFFFF); // Wrap to 0xFFFF
|
||||
(*_selected->Rot)[1] = static_cast<short>((s16)((*_selected->Rot)[1] + angle) & 0xFFFF); // Wrap to 0xFFFF
|
||||
break;
|
||||
case GizmoHandle::X_Axis:
|
||||
(*_selected->Rot)[0] = static_cast<short>((s16)((*_selected->Rot)[0] + angle) & 0xFFFF); // Wrap to 0xFFFF
|
||||
break;
|
||||
case GizmoHandle::Y_Axis:
|
||||
(*_selected->Rot)[1] = static_cast<short>((s16)((*_selected->Rot)[1] + angle) & 0xFFFF); // Wrap to 0xFFFF
|
||||
break;
|
||||
case GizmoHandle::Z_Axis:
|
||||
(*_selected->Rot)[2] = static_cast<short>((s16)((*_selected->Rot)[2] + angle) & 0xFFFF); // Wrap to 0xFFFF
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Gizmo::Scale() {
|
||||
|
||||
}
|
||||
|
||||
void Gizmo::Draw() {
|
||||
if (Enabled) {
|
||||
@@ -161,10 +208,13 @@ void Gizmo::DrawHandles() {
|
||||
Vec3s rot = {0, 0, 0};
|
||||
mtxf_pos_rotation_xyz(mainMtx, &Pos.x, rot);
|
||||
//mtxf_scale(mainMtx, 0.05f);
|
||||
if (render_set_position(mainMtx, 0) != 0) {
|
||||
|
||||
|
||||
Editor_AddMatrix(mainMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
//if (render_set_position(mainMtx, 0) != 0) {
|
||||
//gSPDisplayList(gDisplayListHead++, wheels_Spaghetti_002_mesh);
|
||||
//gSPDisplayList(gDisplayListHead++, handle_Cylinder_mesh);
|
||||
}
|
||||
//}
|
||||
|
||||
handle_f3dlite_material_lights = gdSPDefLights1(
|
||||
0x7F, 0x7F, 0x7F,
|
||||
@@ -175,9 +225,10 @@ void Gizmo::DrawHandles() {
|
||||
Vec3f pos1 = {Pos.x, Pos.y, Pos.z - _gizmoOffset};
|
||||
mtxf_pos_rotation_xyz(RedXMtx, pos1, rot1);
|
||||
mtxf_scale(RedXMtx, 0.05);
|
||||
if (render_set_position(RedXMtx, 0) != 0) {
|
||||
gSPDisplayList(gDisplayListHead++, handle_Cylinder_mesh);
|
||||
}
|
||||
Editor_AddMatrix(RedXMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gDisplayListHead++, handle_Cylinder_mesh);
|
||||
//if (render_set_position(RedXMtx, 0) != 0) {
|
||||
//}
|
||||
|
||||
Vec3s rot2 = {0, 0x4000, 0};
|
||||
|
||||
@@ -189,9 +240,10 @@ void Gizmo::DrawHandles() {
|
||||
Vec3f pos2 = {Pos.x - _gizmoOffset, Pos.y, Pos.z};
|
||||
mtxf_pos_rotation_xyz(GreenYMtx, pos2, rot2);
|
||||
mtxf_scale(GreenYMtx, 0.05);
|
||||
if (render_set_position(GreenYMtx, 0) != 0) {
|
||||
gSPDisplayList(gDisplayListHead++, handle_Cylinder_mesh);
|
||||
}
|
||||
Editor_AddMatrix(GreenYMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gDisplayListHead++, handle_Cylinder_mesh);
|
||||
//if (render_set_position(GreenYMtx, 0) != 0) {
|
||||
//}
|
||||
|
||||
Vec3s rot3 = {0x4000, 0, 0};
|
||||
|
||||
@@ -203,8 +255,9 @@ void Gizmo::DrawHandles() {
|
||||
Vec3f pos3 = {Pos.x, Pos.y + _gizmoOffset, Pos.z};
|
||||
mtxf_pos_rotation_xyz(BlueZMtx, pos3, rot3);
|
||||
mtxf_scale(BlueZMtx, 0.05);
|
||||
if (render_set_position(BlueZMtx, 0) != 0) {
|
||||
gSPDisplayList(gDisplayListHead++, handle_Cylinder_mesh);
|
||||
}
|
||||
Editor_AddMatrix(BlueZMtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gDisplayListHead++, handle_Cylinder_mesh);
|
||||
//if (render_set_position(BlueZMtx, 0) != 0) {
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-494
@@ -3,8 +3,9 @@
|
||||
#include <libultraship.h>
|
||||
#include <libultra/gbi.h>
|
||||
#include "Collision.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
namespace EditorNamespace {
|
||||
namespace Editor {
|
||||
|
||||
class Gizmo {
|
||||
public:
|
||||
@@ -17,7 +18,11 @@ public:
|
||||
Z_Axis
|
||||
};
|
||||
|
||||
Gizmo();
|
||||
enum class TranslationMode {
|
||||
Move,
|
||||
Rotate,
|
||||
Scale
|
||||
};
|
||||
|
||||
void Tick();
|
||||
void Draw();
|
||||
@@ -26,6 +31,8 @@ public:
|
||||
void SetGizmo(GameObject* object, Ray ray);
|
||||
void SetGizmoNoCursor(GameObject* object); // Used for scene explorer selection
|
||||
void Translate();
|
||||
void Rotate();
|
||||
void Scale();
|
||||
void DrawHandles();
|
||||
f32 SnapToSurface(FVector* pos);
|
||||
|
||||
@@ -61,496 +68,5 @@ public:
|
||||
GameObject* _selected = nullptr;
|
||||
private:
|
||||
bool _draw = false;
|
||||
|
||||
|
||||
Lights1 handle_f3dlite_material_lights = gdSPDefLights1(
|
||||
0x7F, 0x7F, 0x7F,
|
||||
0xFF, 0xFF, 0xFF, 0x49, 0x49, 0x49);
|
||||
|
||||
|
||||
Vtx handle_Cylinder_mesh_vtx_cull[8] = {
|
||||
{{ {-22, -22, -271}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {-22, -22, 0}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {-22, 22, 0}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {-22, 22, -271}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {22, -22, -271}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {22, -22, 0}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {22, 22, 0}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {22, 22, -271}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
};
|
||||
|
||||
Vtx handle_Cylinder_mesh_vtx_0[329] = {
|
||||
{{ {0, -22, -194}, 0, {240, 506}, {12, 134, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {12, 134, 222, 255} }},
|
||||
{{ {4, -21, -194}, 0, {288, 511}, {12, 134, 222, 255} }},
|
||||
{{ {4, -21, -194}, 0, {288, 511}, {35, 139, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {35, 139, 222, 255} }},
|
||||
{{ {8, -20, -194}, 0, {334, 525}, {35, 139, 222, 255} }},
|
||||
{{ {8, -20, -194}, 0, {334, 525}, {58, 148, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {58, 148, 222, 255} }},
|
||||
{{ {12, -18, -194}, 0, {377, 548}, {58, 148, 222, 255} }},
|
||||
{{ {12, -18, -194}, 0, {377, 548}, {78, 162, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {78, 162, 222, 255} }},
|
||||
{{ {15, -15, -194}, 0, {414, 578}, {78, 162, 222, 255} }},
|
||||
{{ {15, -15, -194}, 0, {414, 578}, {94, 178, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {94, 178, 222, 255} }},
|
||||
{{ {18, -12, -194}, 0, {444, 615}, {94, 178, 222, 255} }},
|
||||
{{ {18, -12, -194}, 0, {444, 615}, {108, 198, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {108, 198, 222, 255} }},
|
||||
{{ {20, -8, -194}, 0, {467, 658}, {108, 198, 222, 255} }},
|
||||
{{ {20, -8, -194}, 0, {467, 658}, {117, 221, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {117, 221, 222, 255} }},
|
||||
{{ {21, -4, -194}, 0, {481, 704}, {117, 221, 222, 255} }},
|
||||
{{ {21, -4, -194}, 0, {481, 704}, {122, 244, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {122, 244, 222, 255} }},
|
||||
{{ {22, 0, -194}, 0, {486, 752}, {122, 244, 222, 255} }},
|
||||
{{ {22, 0, -194}, 0, {486, 752}, {122, 12, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {122, 12, 222, 255} }},
|
||||
{{ {21, 4, -194}, 0, {481, 800}, {122, 12, 222, 255} }},
|
||||
{{ {21, 4, -194}, 0, {481, 800}, {117, 35, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {117, 35, 222, 255} }},
|
||||
{{ {20, 8, -194}, 0, {467, 846}, {117, 35, 222, 255} }},
|
||||
{{ {20, 8, -194}, 0, {467, 846}, {108, 58, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {108, 58, 222, 255} }},
|
||||
{{ {18, 12, -194}, 0, {444, 889}, {108, 58, 222, 255} }},
|
||||
{{ {18, 12, -194}, 0, {444, 889}, {94, 78, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {94, 78, 222, 255} }},
|
||||
{{ {15, 15, -194}, 0, {414, 926}, {94, 78, 222, 255} }},
|
||||
{{ {15, 15, -194}, 0, {414, 926}, {78, 94, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {78, 94, 222, 255} }},
|
||||
{{ {12, 18, -194}, 0, {377, 956}, {78, 94, 222, 255} }},
|
||||
{{ {12, 18, -194}, 0, {377, 956}, {58, 108, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {58, 108, 222, 255} }},
|
||||
{{ {8, 20, -194}, 0, {334, 979}, {58, 108, 222, 255} }},
|
||||
{{ {8, 20, -194}, 0, {334, 979}, {35, 117, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {35, 117, 222, 255} }},
|
||||
{{ {4, 21, -194}, 0, {288, 993}, {35, 117, 222, 255} }},
|
||||
{{ {4, 21, -194}, 0, {288, 993}, {12, 122, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {12, 122, 222, 255} }},
|
||||
{{ {0, 22, -194}, 0, {240, 998}, {12, 122, 222, 255} }},
|
||||
{{ {0, 22, -194}, 0, {240, 998}, {244, 122, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {244, 122, 222, 255} }},
|
||||
{{ {-4, 21, -194}, 0, {192, 993}, {244, 122, 222, 255} }},
|
||||
{{ {-4, 21, -194}, 0, {192, 993}, {221, 117, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {221, 117, 222, 255} }},
|
||||
{{ {-8, 20, -194}, 0, {146, 979}, {221, 117, 222, 255} }},
|
||||
{{ {-8, 20, -194}, 0, {146, 979}, {198, 108, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {198, 108, 222, 255} }},
|
||||
{{ {-12, 18, -194}, 0, {103, 956}, {198, 108, 222, 255} }},
|
||||
{{ {-12, 18, -194}, 0, {103, 956}, {178, 94, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {178, 94, 222, 255} }},
|
||||
{{ {-15, 15, -194}, 0, {66, 926}, {178, 94, 222, 255} }},
|
||||
{{ {-15, 15, -194}, 0, {66, 926}, {162, 78, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {162, 78, 222, 255} }},
|
||||
{{ {-18, 12, -194}, 0, {36, 889}, {162, 78, 222, 255} }},
|
||||
{{ {-18, 12, -194}, 0, {36, 889}, {148, 58, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {148, 58, 222, 255} }},
|
||||
{{ {-20, 8, -194}, 0, {13, 846}, {148, 58, 222, 255} }},
|
||||
{{ {-20, 8, -194}, 0, {13, 846}, {139, 35, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {139, 35, 222, 255} }},
|
||||
{{ {-21, 4, -194}, 0, {-1, 800}, {139, 35, 222, 255} }},
|
||||
{{ {-21, 4, -194}, 0, {-1, 800}, {134, 12, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {134, 12, 222, 255} }},
|
||||
{{ {-22, 0, -194}, 0, {-6, 752}, {134, 12, 222, 255} }},
|
||||
{{ {-22, 0, -194}, 0, {-6, 752}, {134, 244, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {134, 244, 222, 255} }},
|
||||
{{ {-21, -4, -194}, 0, {-1, 704}, {134, 244, 222, 255} }},
|
||||
{{ {-21, -4, -194}, 0, {-1, 704}, {139, 221, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {139, 221, 222, 255} }},
|
||||
{{ {-20, -8, -194}, 0, {13, 658}, {139, 221, 222, 255} }},
|
||||
{{ {-20, -8, -194}, 0, {13, 658}, {148, 198, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {148, 198, 222, 255} }},
|
||||
{{ {-18, -12, -194}, 0, {36, 615}, {148, 198, 222, 255} }},
|
||||
{{ {-18, -12, -194}, 0, {36, 615}, {162, 178, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {162, 178, 222, 255} }},
|
||||
{{ {-15, -15, -194}, 0, {66, 578}, {162, 178, 222, 255} }},
|
||||
{{ {-15, -15, -194}, 0, {66, 578}, {178, 162, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {178, 162, 222, 255} }},
|
||||
{{ {-12, -18, -194}, 0, {103, 548}, {178, 162, 222, 255} }},
|
||||
{{ {-12, -18, -194}, 0, {103, 548}, {198, 148, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {198, 148, 222, 255} }},
|
||||
{{ {-8, -20, -194}, 0, {146, 525}, {198, 148, 222, 255} }},
|
||||
{{ {-8, -20, -194}, 0, {146, 525}, {221, 139, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {221, 139, 222, 255} }},
|
||||
{{ {-4, -21, -194}, 0, {192, 511}, {221, 139, 222, 255} }},
|
||||
{{ {-4, -21, -194}, 0, {192, 511}, {244, 134, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {244, 134, 222, 255} }},
|
||||
{{ {0, -22, -194}, 0, {240, 506}, {244, 134, 222, 255} }},
|
||||
{{ {0, 9, -194}, 0, {1008, 496}, {12, 126, 0, 255} }},
|
||||
{{ {0, 9, 0}, 0, {1008, -16}, {12, 126, 0, 255} }},
|
||||
{{ {2, 9, 0}, 0, {976, -16}, {12, 126, 0, 255} }},
|
||||
{{ {2, 9, -194}, 0, {976, 496}, {12, 126, 0, 255} }},
|
||||
{{ {2, 9, -194}, 0, {976, 496}, {37, 122, 0, 255} }},
|
||||
{{ {2, 9, 0}, 0, {976, -16}, {37, 122, 0, 255} }},
|
||||
{{ {3, 8, 0}, 0, {944, -16}, {37, 122, 0, 255} }},
|
||||
{{ {3, 8, -194}, 0, {944, 496}, {37, 122, 0, 255} }},
|
||||
{{ {3, 8, -194}, 0, {944, 496}, {60, 112, 0, 255} }},
|
||||
{{ {3, 8, 0}, 0, {944, -16}, {60, 112, 0, 255} }},
|
||||
{{ {5, 7, 0}, 0, {912, -16}, {60, 112, 0, 255} }},
|
||||
{{ {5, 7, -194}, 0, {912, 496}, {60, 112, 0, 255} }},
|
||||
{{ {5, 7, -194}, 0, {912, 496}, {81, 98, 0, 255} }},
|
||||
{{ {5, 7, 0}, 0, {912, -16}, {81, 98, 0, 255} }},
|
||||
{{ {6, 6, 0}, 0, {880, -16}, {81, 98, 0, 255} }},
|
||||
{{ {6, 6, -194}, 0, {880, 496}, {81, 98, 0, 255} }},
|
||||
{{ {6, 6, -194}, 0, {880, 496}, {98, 81, 0, 255} }},
|
||||
{{ {6, 6, 0}, 0, {880, -16}, {98, 81, 0, 255} }},
|
||||
{{ {7, 5, 0}, 0, {848, -16}, {98, 81, 0, 255} }},
|
||||
{{ {7, 5, -194}, 0, {848, 496}, {98, 81, 0, 255} }},
|
||||
{{ {7, 5, -194}, 0, {848, 496}, {112, 60, 0, 255} }},
|
||||
{{ {7, 5, 0}, 0, {848, -16}, {112, 60, 0, 255} }},
|
||||
{{ {8, 3, 0}, 0, {816, -16}, {112, 60, 0, 255} }},
|
||||
{{ {8, 3, -194}, 0, {816, 496}, {112, 60, 0, 255} }},
|
||||
{{ {8, 3, -194}, 0, {816, 496}, {122, 37, 0, 255} }},
|
||||
{{ {8, 3, 0}, 0, {816, -16}, {122, 37, 0, 255} }},
|
||||
{{ {9, 2, 0}, 0, {784, -16}, {122, 37, 0, 255} }},
|
||||
{{ {9, 2, -194}, 0, {784, 496}, {122, 37, 0, 255} }},
|
||||
{{ {9, 2, -194}, 0, {784, 496}, {126, 12, 0, 255} }},
|
||||
{{ {9, 2, 0}, 0, {784, -16}, {126, 12, 0, 255} }},
|
||||
{{ {9, 0, 0}, 0, {752, -16}, {126, 12, 0, 255} }},
|
||||
{{ {9, 0, -194}, 0, {752, 496}, {126, 12, 0, 255} }},
|
||||
{{ {9, 0, -194}, 0, {752, 496}, {126, 244, 0, 255} }},
|
||||
{{ {9, 0, 0}, 0, {752, -16}, {126, 244, 0, 255} }},
|
||||
{{ {9, -2, 0}, 0, {720, -16}, {126, 244, 0, 255} }},
|
||||
{{ {9, -2, -194}, 0, {720, 496}, {126, 244, 0, 255} }},
|
||||
{{ {9, -2, -194}, 0, {720, 496}, {122, 219, 0, 255} }},
|
||||
{{ {9, -2, 0}, 0, {720, -16}, {122, 219, 0, 255} }},
|
||||
{{ {8, -3, 0}, 0, {688, -16}, {122, 219, 0, 255} }},
|
||||
{{ {8, -3, -194}, 0, {688, 496}, {122, 219, 0, 255} }},
|
||||
{{ {8, -3, -194}, 0, {688, 496}, {112, 196, 0, 255} }},
|
||||
{{ {8, -3, 0}, 0, {688, -16}, {112, 196, 0, 255} }},
|
||||
{{ {7, -5, 0}, 0, {656, -16}, {112, 196, 0, 255} }},
|
||||
{{ {7, -5, -194}, 0, {656, 496}, {112, 196, 0, 255} }},
|
||||
{{ {7, -5, -194}, 0, {656, 496}, {98, 175, 0, 255} }},
|
||||
{{ {7, -5, 0}, 0, {656, -16}, {98, 175, 0, 255} }},
|
||||
{{ {6, -6, 0}, 0, {624, -16}, {98, 175, 0, 255} }},
|
||||
{{ {6, -6, -194}, 0, {624, 496}, {98, 175, 0, 255} }},
|
||||
{{ {6, -6, -194}, 0, {624, 496}, {81, 158, 0, 255} }},
|
||||
{{ {6, -6, 0}, 0, {624, -16}, {81, 158, 0, 255} }},
|
||||
{{ {5, -7, 0}, 0, {592, -16}, {81, 158, 0, 255} }},
|
||||
{{ {5, -7, -194}, 0, {592, 496}, {81, 158, 0, 255} }},
|
||||
{{ {5, -7, -194}, 0, {592, 496}, {60, 144, 0, 255} }},
|
||||
{{ {5, -7, 0}, 0, {592, -16}, {60, 144, 0, 255} }},
|
||||
{{ {3, -8, 0}, 0, {560, -16}, {60, 144, 0, 255} }},
|
||||
{{ {3, -8, -194}, 0, {560, 496}, {60, 144, 0, 255} }},
|
||||
{{ {3, -8, -194}, 0, {560, 496}, {37, 134, 0, 255} }},
|
||||
{{ {3, -8, 0}, 0, {560, -16}, {37, 134, 0, 255} }},
|
||||
{{ {2, -9, 0}, 0, {528, -16}, {37, 134, 0, 255} }},
|
||||
{{ {2, -9, -194}, 0, {528, 496}, {37, 134, 0, 255} }},
|
||||
{{ {2, -9, -194}, 0, {528, 496}, {12, 130, 0, 255} }},
|
||||
{{ {2, -9, 0}, 0, {528, -16}, {12, 130, 0, 255} }},
|
||||
{{ {0, -9, 0}, 0, {496, -16}, {12, 130, 0, 255} }},
|
||||
{{ {0, -9, -194}, 0, {496, 496}, {12, 130, 0, 255} }},
|
||||
{{ {0, -9, -194}, 0, {496, 496}, {244, 130, 0, 255} }},
|
||||
{{ {0, -9, 0}, 0, {496, -16}, {244, 130, 0, 255} }},
|
||||
{{ {-2, -9, 0}, 0, {464, -16}, {244, 130, 0, 255} }},
|
||||
{{ {-2, -9, -194}, 0, {464, 496}, {244, 130, 0, 255} }},
|
||||
{{ {-2, -9, -194}, 0, {464, 496}, {219, 134, 0, 255} }},
|
||||
{{ {-2, -9, 0}, 0, {464, -16}, {219, 134, 0, 255} }},
|
||||
{{ {-3, -8, 0}, 0, {432, -16}, {219, 134, 0, 255} }},
|
||||
{{ {-3, -8, -194}, 0, {432, 496}, {219, 134, 0, 255} }},
|
||||
{{ {-3, -8, -194}, 0, {432, 496}, {196, 144, 0, 255} }},
|
||||
{{ {-3, -8, 0}, 0, {432, -16}, {196, 144, 0, 255} }},
|
||||
{{ {-5, -7, 0}, 0, {400, -16}, {196, 144, 0, 255} }},
|
||||
{{ {-5, -7, -194}, 0, {400, 496}, {196, 144, 0, 255} }},
|
||||
{{ {-5, -7, -194}, 0, {400, 496}, {175, 158, 0, 255} }},
|
||||
{{ {-5, -7, 0}, 0, {400, -16}, {175, 158, 0, 255} }},
|
||||
{{ {-6, -6, 0}, 0, {368, -16}, {175, 158, 0, 255} }},
|
||||
{{ {-6, -6, -194}, 0, {368, 496}, {175, 158, 0, 255} }},
|
||||
{{ {-6, -6, -194}, 0, {368, 496}, {158, 175, 0, 255} }},
|
||||
{{ {-6, -6, 0}, 0, {368, -16}, {158, 175, 0, 255} }},
|
||||
{{ {-7, -5, 0}, 0, {336, -16}, {158, 175, 0, 255} }},
|
||||
{{ {-7, -5, -194}, 0, {336, 496}, {158, 175, 0, 255} }},
|
||||
{{ {-7, -5, -194}, 0, {336, 496}, {144, 196, 0, 255} }},
|
||||
{{ {-7, -5, 0}, 0, {336, -16}, {144, 196, 0, 255} }},
|
||||
{{ {-8, -3, 0}, 0, {304, -16}, {144, 196, 0, 255} }},
|
||||
{{ {-8, -3, -194}, 0, {304, 496}, {144, 196, 0, 255} }},
|
||||
{{ {-8, -3, -194}, 0, {304, 496}, {134, 219, 0, 255} }},
|
||||
{{ {-8, -3, 0}, 0, {304, -16}, {134, 219, 0, 255} }},
|
||||
{{ {-9, -2, 0}, 0, {272, -16}, {134, 219, 0, 255} }},
|
||||
{{ {-9, -2, -194}, 0, {272, 496}, {134, 219, 0, 255} }},
|
||||
{{ {-9, -2, -194}, 0, {272, 496}, {130, 244, 0, 255} }},
|
||||
{{ {-9, -2, 0}, 0, {272, -16}, {130, 244, 0, 255} }},
|
||||
{{ {-9, 0, 0}, 0, {240, -16}, {130, 244, 0, 255} }},
|
||||
{{ {-9, 0, -194}, 0, {240, 496}, {130, 244, 0, 255} }},
|
||||
{{ {-9, 0, -194}, 0, {240, 496}, {130, 12, 0, 255} }},
|
||||
{{ {-9, 0, 0}, 0, {240, -16}, {130, 12, 0, 255} }},
|
||||
{{ {-9, 2, 0}, 0, {208, -16}, {130, 12, 0, 255} }},
|
||||
{{ {-9, 2, -194}, 0, {208, 496}, {130, 12, 0, 255} }},
|
||||
{{ {-9, 2, -194}, 0, {208, 496}, {134, 37, 0, 255} }},
|
||||
{{ {-9, 2, 0}, 0, {208, -16}, {134, 37, 0, 255} }},
|
||||
{{ {-8, 3, 0}, 0, {176, -16}, {134, 37, 0, 255} }},
|
||||
{{ {-8, 3, -194}, 0, {176, 496}, {134, 37, 0, 255} }},
|
||||
{{ {-8, 3, -194}, 0, {176, 496}, {144, 60, 0, 255} }},
|
||||
{{ {-8, 3, 0}, 0, {176, -16}, {144, 60, 0, 255} }},
|
||||
{{ {-7, 5, 0}, 0, {144, -16}, {144, 60, 0, 255} }},
|
||||
{{ {-7, 5, -194}, 0, {144, 496}, {144, 60, 0, 255} }},
|
||||
{{ {-7, 5, -194}, 0, {144, 496}, {158, 81, 0, 255} }},
|
||||
{{ {-7, 5, 0}, 0, {144, -16}, {158, 81, 0, 255} }},
|
||||
{{ {-6, 6, 0}, 0, {112, -16}, {158, 81, 0, 255} }},
|
||||
{{ {-6, 6, -194}, 0, {112, 496}, {158, 81, 0, 255} }},
|
||||
{{ {-6, 6, -194}, 0, {112, 496}, {175, 98, 0, 255} }},
|
||||
{{ {-6, 6, 0}, 0, {112, -16}, {175, 98, 0, 255} }},
|
||||
{{ {-5, 7, 0}, 0, {80, -16}, {175, 98, 0, 255} }},
|
||||
{{ {-5, 7, -194}, 0, {80, 496}, {175, 98, 0, 255} }},
|
||||
{{ {-5, 7, -194}, 0, {80, 496}, {196, 112, 0, 255} }},
|
||||
{{ {-5, 7, 0}, 0, {80, -16}, {196, 112, 0, 255} }},
|
||||
{{ {-3, 8, 0}, 0, {48, -16}, {196, 112, 0, 255} }},
|
||||
{{ {-3, 8, -194}, 0, {48, 496}, {196, 112, 0, 255} }},
|
||||
{{ {3, 8, 0}, 0, {334, 525}, {0, 0, 127, 255} }},
|
||||
{{ {2, 9, 0}, 0, {288, 511}, {0, 0, 127, 255} }},
|
||||
{{ {0, 9, 0}, 0, {240, 506}, {0, 0, 127, 255} }},
|
||||
{{ {-3, 8, 0}, 0, {146, 525}, {0, 0, 127, 255} }},
|
||||
{{ {-2, 9, 0}, 0, {192, 511}, {0, 0, 127, 255} }},
|
||||
{{ {-8, 3, 0}, 0, {13, 658}, {0, 0, 127, 255} }},
|
||||
{{ {-6, 6, 0}, 0, {66, 578}, {0, 0, 127, 255} }},
|
||||
{{ {-5, 7, 0}, 0, {103, 548}, {0, 0, 127, 255} }},
|
||||
{{ {-7, 5, 0}, 0, {36, 615}, {0, 0, 127, 255} }},
|
||||
{{ {-9, 2, 0}, 0, {-1, 704}, {0, 0, 127, 255} }},
|
||||
{{ {-9, 0, 0}, 0, {-6, 752}, {0, 0, 127, 255} }},
|
||||
{{ {-8, -3, 0}, 0, {13, 846}, {0, 0, 127, 255} }},
|
||||
{{ {-9, -2, 0}, 0, {-1, 800}, {0, 0, 127, 255} }},
|
||||
{{ {-3, -8, 0}, 0, {146, 979}, {0, 0, 127, 255} }},
|
||||
{{ {-6, -6, 0}, 0, {66, 926}, {0, 0, 127, 255} }},
|
||||
{{ {-7, -5, 0}, 0, {36, 889}, {0, 0, 127, 255} }},
|
||||
{{ {-5, -7, 0}, 0, {103, 956}, {0, 0, 127, 255} }},
|
||||
{{ {-2, -9, 0}, 0, {192, 993}, {0, 0, 127, 255} }},
|
||||
{{ {0, -9, 0}, 0, {240, 998}, {0, 0, 127, 255} }},
|
||||
{{ {3, -8, 0}, 0, {334, 979}, {0, 0, 127, 255} }},
|
||||
{{ {2, -9, 0}, 0, {288, 993}, {0, 0, 127, 255} }},
|
||||
{{ {8, -3, 0}, 0, {467, 846}, {0, 0, 127, 255} }},
|
||||
{{ {6, -6, 0}, 0, {414, 926}, {0, 0, 127, 255} }},
|
||||
{{ {5, -7, 0}, 0, {377, 956}, {0, 0, 127, 255} }},
|
||||
{{ {7, -5, 0}, 0, {444, 889}, {0, 0, 127, 255} }},
|
||||
{{ {9, -2, 0}, 0, {481, 800}, {0, 0, 127, 255} }},
|
||||
{{ {9, 0, 0}, 0, {486, 752}, {0, 0, 127, 255} }},
|
||||
{{ {8, 3, 0}, 0, {467, 658}, {0, 0, 127, 255} }},
|
||||
{{ {9, 2, 0}, 0, {481, 704}, {0, 0, 127, 255} }},
|
||||
{{ {6, 6, 0}, 0, {414, 578}, {0, 0, 127, 255} }},
|
||||
{{ {7, 5, 0}, 0, {444, 615}, {0, 0, 127, 255} }},
|
||||
{{ {5, 7, 0}, 0, {377, 548}, {0, 0, 127, 255} }},
|
||||
{{ {-3, 8, -194}, 0, {48, 496}, {219, 122, 0, 255} }},
|
||||
{{ {-3, 8, 0}, 0, {48, -16}, {219, 122, 0, 255} }},
|
||||
{{ {-2, 9, 0}, 0, {16, -16}, {219, 122, 0, 255} }},
|
||||
{{ {-2, 9, -194}, 0, {16, 496}, {219, 122, 0, 255} }},
|
||||
{{ {-2, 9, -194}, 0, {16, 496}, {244, 126, 0, 255} }},
|
||||
{{ {-2, 9, 0}, 0, {16, -16}, {244, 126, 0, 255} }},
|
||||
{{ {0, 9, 0}, 0, {-16, -16}, {244, 126, 0, 255} }},
|
||||
{{ {0, 9, -194}, 0, {-16, 496}, {244, 126, 0, 255} }},
|
||||
{{ {-2, 9, -194}, 0, {704, 511}, {0, 0, 129, 255} }},
|
||||
{{ {0, 9, -194}, 0, {752, 506}, {0, 0, 129, 255} }},
|
||||
{{ {2, 9, -194}, 0, {800, 511}, {0, 0, 129, 255} }},
|
||||
{{ {5, 7, -194}, 0, {889, 548}, {0, 0, 129, 255} }},
|
||||
{{ {3, 8, -194}, 0, {846, 525}, {0, 0, 129, 255} }},
|
||||
{{ {9, 2, -194}, 0, {993, 704}, {0, 0, 129, 255} }},
|
||||
{{ {7, 5, -194}, 0, {956, 615}, {0, 0, 129, 255} }},
|
||||
{{ {6, 6, -194}, 0, {926, 578}, {0, 0, 129, 255} }},
|
||||
{{ {8, 3, -194}, 0, {979, 658}, {0, 0, 129, 255} }},
|
||||
{{ {9, 0, -194}, 0, {998, 752}, {0, 0, 129, 255} }},
|
||||
{{ {9, -2, -194}, 0, {993, 800}, {0, 0, 129, 255} }},
|
||||
{{ {7, -5, -194}, 0, {956, 889}, {0, 0, 129, 255} }},
|
||||
{{ {8, -3, -194}, 0, {979, 846}, {0, 0, 129, 255} }},
|
||||
{{ {2, -9, -194}, 0, {800, 993}, {0, 0, 129, 255} }},
|
||||
{{ {5, -7, -194}, 0, {889, 956}, {0, 0, 129, 255} }},
|
||||
{{ {6, -6, -194}, 0, {926, 926}, {0, 0, 129, 255} }},
|
||||
{{ {3, -8, -194}, 0, {846, 979}, {0, 0, 129, 255} }},
|
||||
{{ {0, -9, -194}, 0, {752, 998}, {0, 0, 129, 255} }},
|
||||
{{ {-2, -9, -194}, 0, {704, 993}, {0, 0, 129, 255} }},
|
||||
{{ {-5, -7, -194}, 0, {615, 956}, {0, 0, 129, 255} }},
|
||||
{{ {-3, -8, -194}, 0, {658, 979}, {0, 0, 129, 255} }},
|
||||
{{ {-9, -2, -194}, 0, {511, 800}, {0, 0, 129, 255} }},
|
||||
{{ {-7, -5, -194}, 0, {548, 889}, {0, 0, 129, 255} }},
|
||||
{{ {-6, -6, -194}, 0, {578, 926}, {0, 0, 129, 255} }},
|
||||
{{ {-7, -5, -194}, 0, {548, 889}, {0, 0, 129, 255} }},
|
||||
{{ {-8, -3, -194}, 0, {525, 846}, {0, 0, 129, 255} }},
|
||||
{{ {-9, -2, -194}, 0, {511, 800}, {0, 0, 129, 255} }},
|
||||
{{ {-9, 0, -194}, 0, {506, 752}, {0, 0, 129, 255} }},
|
||||
{{ {-9, 2, -194}, 0, {511, 704}, {0, 0, 129, 255} }},
|
||||
{{ {-7, 5, -194}, 0, {548, 615}, {0, 0, 129, 255} }},
|
||||
{{ {-8, 3, -194}, 0, {525, 658}, {0, 0, 129, 255} }},
|
||||
{{ {-2, 9, -194}, 0, {704, 511}, {0, 0, 129, 255} }},
|
||||
{{ {-5, 7, -194}, 0, {615, 548}, {0, 0, 129, 255} }},
|
||||
{{ {-6, 6, -194}, 0, {578, 578}, {0, 0, 129, 255} }},
|
||||
{{ {-3, 8, -194}, 0, {658, 525}, {0, 0, 129, 255} }},
|
||||
{{ {9, 2, -194}, 0, {993, 704}, {0, 0, 129, 255} }},
|
||||
{{ {2, -9, -194}, 0, {800, 993}, {0, 0, 129, 255} }},
|
||||
{{ {-4, -21, -194}, 0, {704, 511}, {0, 0, 127, 255} }},
|
||||
{{ {0, -22, -194}, 0, {752, 506}, {0, 0, 127, 255} }},
|
||||
{{ {4, -21, -194}, 0, {800, 511}, {0, 0, 127, 255} }},
|
||||
{{ {12, -18, -194}, 0, {889, 548}, {0, 0, 127, 255} }},
|
||||
{{ {8, -20, -194}, 0, {846, 525}, {0, 0, 127, 255} }},
|
||||
{{ {21, -4, -194}, 0, {993, 704}, {0, 0, 127, 255} }},
|
||||
{{ {18, -12, -194}, 0, {956, 615}, {0, 0, 127, 255} }},
|
||||
{{ {15, -15, -194}, 0, {926, 578}, {0, 0, 127, 255} }},
|
||||
{{ {20, -8, -194}, 0, {979, 658}, {0, 0, 127, 255} }},
|
||||
{{ {22, 0, -194}, 0, {998, 752}, {0, 0, 127, 255} }},
|
||||
{{ {21, 4, -194}, 0, {993, 800}, {0, 0, 127, 255} }},
|
||||
{{ {18, 12, -194}, 0, {956, 889}, {0, 0, 127, 255} }},
|
||||
{{ {20, 8, -194}, 0, {979, 846}, {0, 0, 127, 255} }},
|
||||
{{ {4, 21, -194}, 0, {800, 993}, {0, 0, 127, 255} }},
|
||||
{{ {12, 18, -194}, 0, {889, 956}, {0, 0, 127, 255} }},
|
||||
{{ {15, 15, -194}, 0, {926, 926}, {0, 0, 127, 255} }},
|
||||
{{ {8, 20, -194}, 0, {846, 979}, {0, 0, 127, 255} }},
|
||||
{{ {0, 22, -194}, 0, {752, 998}, {0, 0, 127, 255} }},
|
||||
{{ {-4, 21, -194}, 0, {704, 993}, {0, 0, 127, 255} }},
|
||||
{{ {4, 21, -194}, 0, {800, 993}, {0, 0, 127, 255} }},
|
||||
{{ {-4, 21, -194}, 0, {704, 993}, {0, 0, 127, 255} }},
|
||||
{{ {-12, 18, -194}, 0, {615, 956}, {0, 0, 127, 255} }},
|
||||
{{ {-8, 20, -194}, 0, {658, 979}, {0, 0, 127, 255} }},
|
||||
{{ {-21, 4, -194}, 0, {511, 800}, {0, 0, 127, 255} }},
|
||||
{{ {-18, 12, -194}, 0, {548, 889}, {0, 0, 127, 255} }},
|
||||
{{ {-15, 15, -194}, 0, {578, 926}, {0, 0, 127, 255} }},
|
||||
{{ {-20, 8, -194}, 0, {525, 846}, {0, 0, 127, 255} }},
|
||||
{{ {-22, 0, -194}, 0, {506, 752}, {0, 0, 127, 255} }},
|
||||
{{ {-21, -4, -194}, 0, {511, 704}, {0, 0, 127, 255} }},
|
||||
{{ {-18, -12, -194}, 0, {548, 615}, {0, 0, 127, 255} }},
|
||||
{{ {-20, -8, -194}, 0, {525, 658}, {0, 0, 127, 255} }},
|
||||
{{ {-4, -21, -194}, 0, {704, 511}, {0, 0, 127, 255} }},
|
||||
{{ {-12, -18, -194}, 0, {615, 548}, {0, 0, 127, 255} }},
|
||||
{{ {-15, -15, -194}, 0, {578, 578}, {0, 0, 127, 255} }},
|
||||
{{ {-8, -20, -194}, 0, {658, 525}, {0, 0, 127, 255} }},
|
||||
{{ {21, -4, -194}, 0, {993, 704}, {0, 0, 127, 255} }},
|
||||
};
|
||||
Gfx handle_Cylinder_mesh_tri_0[106] = {
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 0, 30, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
|
||||
gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 15, 16, 17, 0),
|
||||
gsSP2Triangles(18, 19, 20, 0, 21, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 27, 28, 29, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 30, 30, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
|
||||
gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 15, 16, 17, 0),
|
||||
gsSP2Triangles(18, 19, 20, 0, 21, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 27, 28, 29, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 60, 30, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
|
||||
gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 15, 16, 17, 0),
|
||||
gsSP2Triangles(18, 19, 20, 0, 21, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 27, 28, 29, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 90, 30, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
|
||||
gsSP2Triangles(6, 7, 8, 0, 6, 8, 9, 0),
|
||||
gsSP2Triangles(10, 11, 12, 0, 10, 12, 13, 0),
|
||||
gsSP2Triangles(14, 15, 16, 0, 14, 16, 17, 0),
|
||||
gsSP2Triangles(18, 19, 20, 0, 18, 20, 21, 0),
|
||||
gsSP2Triangles(22, 23, 24, 0, 22, 24, 25, 0),
|
||||
gsSP2Triangles(26, 27, 28, 0, 26, 28, 29, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 120, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
|
||||
gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 12, 14, 15, 0),
|
||||
gsSP2Triangles(16, 17, 18, 0, 16, 18, 19, 0),
|
||||
gsSP2Triangles(20, 21, 22, 0, 20, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 24, 26, 27, 0),
|
||||
gsSP2Triangles(28, 29, 30, 0, 28, 30, 31, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 152, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
|
||||
gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 12, 14, 15, 0),
|
||||
gsSP2Triangles(16, 17, 18, 0, 16, 18, 19, 0),
|
||||
gsSP2Triangles(20, 21, 22, 0, 20, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 24, 26, 27, 0),
|
||||
gsSP2Triangles(28, 29, 30, 0, 28, 30, 31, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 184, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
|
||||
gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 12, 14, 15, 0),
|
||||
gsSP2Triangles(16, 17, 18, 0, 16, 18, 19, 0),
|
||||
gsSP2Triangles(20, 21, 22, 0, 20, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 24, 26, 27, 0),
|
||||
gsSP2Triangles(28, 29, 30, 0, 28, 30, 31, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 216, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(2, 4, 3, 0, 0, 3, 5, 0),
|
||||
gsSP2Triangles(3, 6, 5, 0, 3, 7, 6, 0),
|
||||
gsSP2Triangles(6, 8, 5, 0, 5, 9, 10, 0),
|
||||
gsSP2Triangles(5, 10, 11, 0, 10, 12, 11, 0),
|
||||
gsSP2Triangles(5, 11, 13, 0, 11, 14, 13, 0),
|
||||
gsSP2Triangles(11, 15, 14, 0, 14, 16, 13, 0),
|
||||
gsSP2Triangles(13, 17, 18, 0, 13, 18, 19, 0),
|
||||
gsSP2Triangles(18, 20, 19, 0, 13, 19, 21, 0),
|
||||
gsSP2Triangles(19, 22, 21, 0, 19, 23, 22, 0),
|
||||
gsSP2Triangles(22, 24, 21, 0, 21, 25, 26, 0),
|
||||
gsSP2Triangles(21, 26, 27, 0, 26, 28, 27, 0),
|
||||
gsSP2Triangles(21, 27, 0, 0, 27, 29, 0, 0),
|
||||
gsSP2Triangles(27, 30, 29, 0, 29, 31, 0, 0),
|
||||
gsSP2Triangles(0, 5, 13, 0, 13, 21, 0, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 248, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
|
||||
gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0),
|
||||
gsSP2Triangles(10, 12, 11, 0, 8, 11, 13, 0),
|
||||
gsSP2Triangles(11, 14, 13, 0, 11, 15, 14, 0),
|
||||
gsSP2Triangles(14, 16, 13, 0, 13, 17, 18, 0),
|
||||
gsSP2Triangles(13, 18, 19, 0, 18, 20, 19, 0),
|
||||
gsSP2Triangles(13, 19, 21, 0, 19, 22, 21, 0),
|
||||
gsSP2Triangles(19, 23, 22, 0, 22, 24, 21, 0),
|
||||
gsSP2Triangles(21, 25, 26, 0, 21, 26, 27, 0),
|
||||
gsSP2Triangles(26, 28, 27, 0, 21, 27, 29, 0),
|
||||
gsSP2Triangles(27, 30, 29, 0, 27, 31, 30, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 280, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 2, 3, 4, 0),
|
||||
gsSP2Triangles(2, 4, 5, 0, 4, 6, 5, 0),
|
||||
gsSP2Triangles(2, 5, 7, 0, 5, 8, 7, 0),
|
||||
gsSP2Triangles(5, 9, 8, 0, 8, 10, 7, 0),
|
||||
gsSP2Triangles(7, 11, 12, 0, 12, 2, 7, 0),
|
||||
gsSP2Triangles(13, 14, 15, 0, 13, 15, 16, 0),
|
||||
gsSP2Triangles(15, 17, 16, 0, 13, 16, 18, 0),
|
||||
gsSP2Triangles(16, 19, 18, 0, 16, 20, 19, 0),
|
||||
gsSP2Triangles(19, 21, 18, 0, 18, 22, 23, 0),
|
||||
gsSP2Triangles(18, 23, 24, 0, 23, 25, 24, 0),
|
||||
gsSP2Triangles(18, 24, 26, 0, 24, 27, 26, 0),
|
||||
gsSP2Triangles(24, 28, 27, 0, 27, 29, 26, 0),
|
||||
gsSP1Triangle(26, 30, 31, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 312, 17, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0),
|
||||
gsSP2Triangles(0, 2, 4, 0, 2, 5, 4, 0),
|
||||
gsSP2Triangles(2, 6, 5, 0, 5, 7, 4, 0),
|
||||
gsSP2Triangles(4, 8, 9, 0, 4, 9, 10, 0),
|
||||
gsSP2Triangles(9, 11, 10, 0, 4, 10, 12, 0),
|
||||
gsSP2Triangles(10, 13, 12, 0, 10, 14, 13, 0),
|
||||
gsSP2Triangles(13, 15, 12, 0, 12, 16, 0, 0),
|
||||
gsSP1Triangle(0, 4, 12, 0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx mat_handle_f3dlite_material[9] = {
|
||||
gsSPClearGeometryMode(G_CLIPPING | G_ZBUFFER),
|
||||
gsSPSetLights1(handle_f3dlite_material_lights),
|
||||
gsDPPipeSync(),
|
||||
gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT),
|
||||
gsDPSetAlphaDither(G_AD_NOISE),
|
||||
gsSPTexture(65535, 65535, 0, 0, 1),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx mat_revert_handle_f3dlite_material[4] = {
|
||||
gsSPSetGeometryMode(G_CLIPPING | G_ZBUFFER),
|
||||
gsDPPipeSync(),
|
||||
gsDPSetAlphaDither(G_AD_DISABLE),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx handle_Cylinder_mesh[13] = {
|
||||
gsSPClearGeometryMode(G_LIGHTING),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_cull + 0, 8, 0),
|
||||
gsSPSetGeometryMode(G_LIGHTING),
|
||||
gsSPCullDisplayList(0, 7),
|
||||
gsSPDisplayList(mat_handle_f3dlite_material),
|
||||
gsSPDisplayList(handle_Cylinder_mesh_tri_0),
|
||||
gsSPDisplayList(mat_revert_handle_f3dlite_material),
|
||||
gsDPPipeSync(),
|
||||
gsSPSetGeometryMode(G_LIGHTING),
|
||||
gsSPClearGeometryMode(G_TEXTURE_GEN),
|
||||
gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT),
|
||||
gsSPTexture(65535, 65535, 0, 0, 0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,493 @@
|
||||
#include <libultraship.h>
|
||||
#include <libultra/gbi.h>
|
||||
|
||||
#include "Handle.h"
|
||||
|
||||
Lights1 handle_f3dlite_material_lights = gdSPDefLights1(
|
||||
0x7F, 0x7F, 0x7F,
|
||||
0xFF, 0xFF, 0xFF, 0x49, 0x49, 0x49);
|
||||
|
||||
|
||||
Vtx handle_Cylinder_mesh_vtx_cull[8] = {
|
||||
{{ {-22, -22, -271}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {-22, -22, 0}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {-22, 22, 0}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {-22, 22, -271}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {22, -22, -271}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {22, -22, 0}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {22, 22, 0}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
{{ {22, 22, -271}, 0, {0, 0}, {0, 0, 0, 0} }},
|
||||
};
|
||||
|
||||
Vtx handle_Cylinder_mesh_vtx_0[329] = {
|
||||
{{ {0, -22, -194}, 0, {240, 506}, {12, 134, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {12, 134, 222, 255} }},
|
||||
{{ {4, -21, -194}, 0, {288, 511}, {12, 134, 222, 255} }},
|
||||
{{ {4, -21, -194}, 0, {288, 511}, {35, 139, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {35, 139, 222, 255} }},
|
||||
{{ {8, -20, -194}, 0, {334, 525}, {35, 139, 222, 255} }},
|
||||
{{ {8, -20, -194}, 0, {334, 525}, {58, 148, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {58, 148, 222, 255} }},
|
||||
{{ {12, -18, -194}, 0, {377, 548}, {58, 148, 222, 255} }},
|
||||
{{ {12, -18, -194}, 0, {377, 548}, {78, 162, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {78, 162, 222, 255} }},
|
||||
{{ {15, -15, -194}, 0, {414, 578}, {78, 162, 222, 255} }},
|
||||
{{ {15, -15, -194}, 0, {414, 578}, {94, 178, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {94, 178, 222, 255} }},
|
||||
{{ {18, -12, -194}, 0, {444, 615}, {94, 178, 222, 255} }},
|
||||
{{ {18, -12, -194}, 0, {444, 615}, {108, 198, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {108, 198, 222, 255} }},
|
||||
{{ {20, -8, -194}, 0, {467, 658}, {108, 198, 222, 255} }},
|
||||
{{ {20, -8, -194}, 0, {467, 658}, {117, 221, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {117, 221, 222, 255} }},
|
||||
{{ {21, -4, -194}, 0, {481, 704}, {117, 221, 222, 255} }},
|
||||
{{ {21, -4, -194}, 0, {481, 704}, {122, 244, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {122, 244, 222, 255} }},
|
||||
{{ {22, 0, -194}, 0, {486, 752}, {122, 244, 222, 255} }},
|
||||
{{ {22, 0, -194}, 0, {486, 752}, {122, 12, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {122, 12, 222, 255} }},
|
||||
{{ {21, 4, -194}, 0, {481, 800}, {122, 12, 222, 255} }},
|
||||
{{ {21, 4, -194}, 0, {481, 800}, {117, 35, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {117, 35, 222, 255} }},
|
||||
{{ {20, 8, -194}, 0, {467, 846}, {117, 35, 222, 255} }},
|
||||
{{ {20, 8, -194}, 0, {467, 846}, {108, 58, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {108, 58, 222, 255} }},
|
||||
{{ {18, 12, -194}, 0, {444, 889}, {108, 58, 222, 255} }},
|
||||
{{ {18, 12, -194}, 0, {444, 889}, {94, 78, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {94, 78, 222, 255} }},
|
||||
{{ {15, 15, -194}, 0, {414, 926}, {94, 78, 222, 255} }},
|
||||
{{ {15, 15, -194}, 0, {414, 926}, {78, 94, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {78, 94, 222, 255} }},
|
||||
{{ {12, 18, -194}, 0, {377, 956}, {78, 94, 222, 255} }},
|
||||
{{ {12, 18, -194}, 0, {377, 956}, {58, 108, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {58, 108, 222, 255} }},
|
||||
{{ {8, 20, -194}, 0, {334, 979}, {58, 108, 222, 255} }},
|
||||
{{ {8, 20, -194}, 0, {334, 979}, {35, 117, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {35, 117, 222, 255} }},
|
||||
{{ {4, 21, -194}, 0, {288, 993}, {35, 117, 222, 255} }},
|
||||
{{ {4, 21, -194}, 0, {288, 993}, {12, 122, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {12, 122, 222, 255} }},
|
||||
{{ {0, 22, -194}, 0, {240, 998}, {12, 122, 222, 255} }},
|
||||
{{ {0, 22, -194}, 0, {240, 998}, {244, 122, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {244, 122, 222, 255} }},
|
||||
{{ {-4, 21, -194}, 0, {192, 993}, {244, 122, 222, 255} }},
|
||||
{{ {-4, 21, -194}, 0, {192, 993}, {221, 117, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {221, 117, 222, 255} }},
|
||||
{{ {-8, 20, -194}, 0, {146, 979}, {221, 117, 222, 255} }},
|
||||
{{ {-8, 20, -194}, 0, {146, 979}, {198, 108, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {198, 108, 222, 255} }},
|
||||
{{ {-12, 18, -194}, 0, {103, 956}, {198, 108, 222, 255} }},
|
||||
{{ {-12, 18, -194}, 0, {103, 956}, {178, 94, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {178, 94, 222, 255} }},
|
||||
{{ {-15, 15, -194}, 0, {66, 926}, {178, 94, 222, 255} }},
|
||||
{{ {-15, 15, -194}, 0, {66, 926}, {162, 78, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {162, 78, 222, 255} }},
|
||||
{{ {-18, 12, -194}, 0, {36, 889}, {162, 78, 222, 255} }},
|
||||
{{ {-18, 12, -194}, 0, {36, 889}, {148, 58, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {148, 58, 222, 255} }},
|
||||
{{ {-20, 8, -194}, 0, {13, 846}, {148, 58, 222, 255} }},
|
||||
{{ {-20, 8, -194}, 0, {13, 846}, {139, 35, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {139, 35, 222, 255} }},
|
||||
{{ {-21, 4, -194}, 0, {-1, 800}, {139, 35, 222, 255} }},
|
||||
{{ {-21, 4, -194}, 0, {-1, 800}, {134, 12, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {134, 12, 222, 255} }},
|
||||
{{ {-22, 0, -194}, 0, {-6, 752}, {134, 12, 222, 255} }},
|
||||
{{ {-22, 0, -194}, 0, {-6, 752}, {134, 244, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {134, 244, 222, 255} }},
|
||||
{{ {-21, -4, -194}, 0, {-1, 704}, {134, 244, 222, 255} }},
|
||||
{{ {-21, -4, -194}, 0, {-1, 704}, {139, 221, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {139, 221, 222, 255} }},
|
||||
{{ {-20, -8, -194}, 0, {13, 658}, {139, 221, 222, 255} }},
|
||||
{{ {-20, -8, -194}, 0, {13, 658}, {148, 198, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {148, 198, 222, 255} }},
|
||||
{{ {-18, -12, -194}, 0, {36, 615}, {148, 198, 222, 255} }},
|
||||
{{ {-18, -12, -194}, 0, {36, 615}, {162, 178, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {162, 178, 222, 255} }},
|
||||
{{ {-15, -15, -194}, 0, {66, 578}, {162, 178, 222, 255} }},
|
||||
{{ {-15, -15, -194}, 0, {66, 578}, {178, 162, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {178, 162, 222, 255} }},
|
||||
{{ {-12, -18, -194}, 0, {103, 548}, {178, 162, 222, 255} }},
|
||||
{{ {-12, -18, -194}, 0, {103, 548}, {198, 148, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {198, 148, 222, 255} }},
|
||||
{{ {-8, -20, -194}, 0, {146, 525}, {198, 148, 222, 255} }},
|
||||
{{ {-8, -20, -194}, 0, {146, 525}, {221, 139, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {221, 139, 222, 255} }},
|
||||
{{ {-4, -21, -194}, 0, {192, 511}, {221, 139, 222, 255} }},
|
||||
{{ {-4, -21, -194}, 0, {192, 511}, {244, 134, 222, 255} }},
|
||||
{{ {0, 0, -271}, 0, {240, 752}, {244, 134, 222, 255} }},
|
||||
{{ {0, -22, -194}, 0, {240, 506}, {244, 134, 222, 255} }},
|
||||
{{ {0, 9, -194}, 0, {1008, 496}, {12, 126, 0, 255} }},
|
||||
{{ {0, 9, 0}, 0, {1008, -16}, {12, 126, 0, 255} }},
|
||||
{{ {2, 9, 0}, 0, {976, -16}, {12, 126, 0, 255} }},
|
||||
{{ {2, 9, -194}, 0, {976, 496}, {12, 126, 0, 255} }},
|
||||
{{ {2, 9, -194}, 0, {976, 496}, {37, 122, 0, 255} }},
|
||||
{{ {2, 9, 0}, 0, {976, -16}, {37, 122, 0, 255} }},
|
||||
{{ {3, 8, 0}, 0, {944, -16}, {37, 122, 0, 255} }},
|
||||
{{ {3, 8, -194}, 0, {944, 496}, {37, 122, 0, 255} }},
|
||||
{{ {3, 8, -194}, 0, {944, 496}, {60, 112, 0, 255} }},
|
||||
{{ {3, 8, 0}, 0, {944, -16}, {60, 112, 0, 255} }},
|
||||
{{ {5, 7, 0}, 0, {912, -16}, {60, 112, 0, 255} }},
|
||||
{{ {5, 7, -194}, 0, {912, 496}, {60, 112, 0, 255} }},
|
||||
{{ {5, 7, -194}, 0, {912, 496}, {81, 98, 0, 255} }},
|
||||
{{ {5, 7, 0}, 0, {912, -16}, {81, 98, 0, 255} }},
|
||||
{{ {6, 6, 0}, 0, {880, -16}, {81, 98, 0, 255} }},
|
||||
{{ {6, 6, -194}, 0, {880, 496}, {81, 98, 0, 255} }},
|
||||
{{ {6, 6, -194}, 0, {880, 496}, {98, 81, 0, 255} }},
|
||||
{{ {6, 6, 0}, 0, {880, -16}, {98, 81, 0, 255} }},
|
||||
{{ {7, 5, 0}, 0, {848, -16}, {98, 81, 0, 255} }},
|
||||
{{ {7, 5, -194}, 0, {848, 496}, {98, 81, 0, 255} }},
|
||||
{{ {7, 5, -194}, 0, {848, 496}, {112, 60, 0, 255} }},
|
||||
{{ {7, 5, 0}, 0, {848, -16}, {112, 60, 0, 255} }},
|
||||
{{ {8, 3, 0}, 0, {816, -16}, {112, 60, 0, 255} }},
|
||||
{{ {8, 3, -194}, 0, {816, 496}, {112, 60, 0, 255} }},
|
||||
{{ {8, 3, -194}, 0, {816, 496}, {122, 37, 0, 255} }},
|
||||
{{ {8, 3, 0}, 0, {816, -16}, {122, 37, 0, 255} }},
|
||||
{{ {9, 2, 0}, 0, {784, -16}, {122, 37, 0, 255} }},
|
||||
{{ {9, 2, -194}, 0, {784, 496}, {122, 37, 0, 255} }},
|
||||
{{ {9, 2, -194}, 0, {784, 496}, {126, 12, 0, 255} }},
|
||||
{{ {9, 2, 0}, 0, {784, -16}, {126, 12, 0, 255} }},
|
||||
{{ {9, 0, 0}, 0, {752, -16}, {126, 12, 0, 255} }},
|
||||
{{ {9, 0, -194}, 0, {752, 496}, {126, 12, 0, 255} }},
|
||||
{{ {9, 0, -194}, 0, {752, 496}, {126, 244, 0, 255} }},
|
||||
{{ {9, 0, 0}, 0, {752, -16}, {126, 244, 0, 255} }},
|
||||
{{ {9, -2, 0}, 0, {720, -16}, {126, 244, 0, 255} }},
|
||||
{{ {9, -2, -194}, 0, {720, 496}, {126, 244, 0, 255} }},
|
||||
{{ {9, -2, -194}, 0, {720, 496}, {122, 219, 0, 255} }},
|
||||
{{ {9, -2, 0}, 0, {720, -16}, {122, 219, 0, 255} }},
|
||||
{{ {8, -3, 0}, 0, {688, -16}, {122, 219, 0, 255} }},
|
||||
{{ {8, -3, -194}, 0, {688, 496}, {122, 219, 0, 255} }},
|
||||
{{ {8, -3, -194}, 0, {688, 496}, {112, 196, 0, 255} }},
|
||||
{{ {8, -3, 0}, 0, {688, -16}, {112, 196, 0, 255} }},
|
||||
{{ {7, -5, 0}, 0, {656, -16}, {112, 196, 0, 255} }},
|
||||
{{ {7, -5, -194}, 0, {656, 496}, {112, 196, 0, 255} }},
|
||||
{{ {7, -5, -194}, 0, {656, 496}, {98, 175, 0, 255} }},
|
||||
{{ {7, -5, 0}, 0, {656, -16}, {98, 175, 0, 255} }},
|
||||
{{ {6, -6, 0}, 0, {624, -16}, {98, 175, 0, 255} }},
|
||||
{{ {6, -6, -194}, 0, {624, 496}, {98, 175, 0, 255} }},
|
||||
{{ {6, -6, -194}, 0, {624, 496}, {81, 158, 0, 255} }},
|
||||
{{ {6, -6, 0}, 0, {624, -16}, {81, 158, 0, 255} }},
|
||||
{{ {5, -7, 0}, 0, {592, -16}, {81, 158, 0, 255} }},
|
||||
{{ {5, -7, -194}, 0, {592, 496}, {81, 158, 0, 255} }},
|
||||
{{ {5, -7, -194}, 0, {592, 496}, {60, 144, 0, 255} }},
|
||||
{{ {5, -7, 0}, 0, {592, -16}, {60, 144, 0, 255} }},
|
||||
{{ {3, -8, 0}, 0, {560, -16}, {60, 144, 0, 255} }},
|
||||
{{ {3, -8, -194}, 0, {560, 496}, {60, 144, 0, 255} }},
|
||||
{{ {3, -8, -194}, 0, {560, 496}, {37, 134, 0, 255} }},
|
||||
{{ {3, -8, 0}, 0, {560, -16}, {37, 134, 0, 255} }},
|
||||
{{ {2, -9, 0}, 0, {528, -16}, {37, 134, 0, 255} }},
|
||||
{{ {2, -9, -194}, 0, {528, 496}, {37, 134, 0, 255} }},
|
||||
{{ {2, -9, -194}, 0, {528, 496}, {12, 130, 0, 255} }},
|
||||
{{ {2, -9, 0}, 0, {528, -16}, {12, 130, 0, 255} }},
|
||||
{{ {0, -9, 0}, 0, {496, -16}, {12, 130, 0, 255} }},
|
||||
{{ {0, -9, -194}, 0, {496, 496}, {12, 130, 0, 255} }},
|
||||
{{ {0, -9, -194}, 0, {496, 496}, {244, 130, 0, 255} }},
|
||||
{{ {0, -9, 0}, 0, {496, -16}, {244, 130, 0, 255} }},
|
||||
{{ {-2, -9, 0}, 0, {464, -16}, {244, 130, 0, 255} }},
|
||||
{{ {-2, -9, -194}, 0, {464, 496}, {244, 130, 0, 255} }},
|
||||
{{ {-2, -9, -194}, 0, {464, 496}, {219, 134, 0, 255} }},
|
||||
{{ {-2, -9, 0}, 0, {464, -16}, {219, 134, 0, 255} }},
|
||||
{{ {-3, -8, 0}, 0, {432, -16}, {219, 134, 0, 255} }},
|
||||
{{ {-3, -8, -194}, 0, {432, 496}, {219, 134, 0, 255} }},
|
||||
{{ {-3, -8, -194}, 0, {432, 496}, {196, 144, 0, 255} }},
|
||||
{{ {-3, -8, 0}, 0, {432, -16}, {196, 144, 0, 255} }},
|
||||
{{ {-5, -7, 0}, 0, {400, -16}, {196, 144, 0, 255} }},
|
||||
{{ {-5, -7, -194}, 0, {400, 496}, {196, 144, 0, 255} }},
|
||||
{{ {-5, -7, -194}, 0, {400, 496}, {175, 158, 0, 255} }},
|
||||
{{ {-5, -7, 0}, 0, {400, -16}, {175, 158, 0, 255} }},
|
||||
{{ {-6, -6, 0}, 0, {368, -16}, {175, 158, 0, 255} }},
|
||||
{{ {-6, -6, -194}, 0, {368, 496}, {175, 158, 0, 255} }},
|
||||
{{ {-6, -6, -194}, 0, {368, 496}, {158, 175, 0, 255} }},
|
||||
{{ {-6, -6, 0}, 0, {368, -16}, {158, 175, 0, 255} }},
|
||||
{{ {-7, -5, 0}, 0, {336, -16}, {158, 175, 0, 255} }},
|
||||
{{ {-7, -5, -194}, 0, {336, 496}, {158, 175, 0, 255} }},
|
||||
{{ {-7, -5, -194}, 0, {336, 496}, {144, 196, 0, 255} }},
|
||||
{{ {-7, -5, 0}, 0, {336, -16}, {144, 196, 0, 255} }},
|
||||
{{ {-8, -3, 0}, 0, {304, -16}, {144, 196, 0, 255} }},
|
||||
{{ {-8, -3, -194}, 0, {304, 496}, {144, 196, 0, 255} }},
|
||||
{{ {-8, -3, -194}, 0, {304, 496}, {134, 219, 0, 255} }},
|
||||
{{ {-8, -3, 0}, 0, {304, -16}, {134, 219, 0, 255} }},
|
||||
{{ {-9, -2, 0}, 0, {272, -16}, {134, 219, 0, 255} }},
|
||||
{{ {-9, -2, -194}, 0, {272, 496}, {134, 219, 0, 255} }},
|
||||
{{ {-9, -2, -194}, 0, {272, 496}, {130, 244, 0, 255} }},
|
||||
{{ {-9, -2, 0}, 0, {272, -16}, {130, 244, 0, 255} }},
|
||||
{{ {-9, 0, 0}, 0, {240, -16}, {130, 244, 0, 255} }},
|
||||
{{ {-9, 0, -194}, 0, {240, 496}, {130, 244, 0, 255} }},
|
||||
{{ {-9, 0, -194}, 0, {240, 496}, {130, 12, 0, 255} }},
|
||||
{{ {-9, 0, 0}, 0, {240, -16}, {130, 12, 0, 255} }},
|
||||
{{ {-9, 2, 0}, 0, {208, -16}, {130, 12, 0, 255} }},
|
||||
{{ {-9, 2, -194}, 0, {208, 496}, {130, 12, 0, 255} }},
|
||||
{{ {-9, 2, -194}, 0, {208, 496}, {134, 37, 0, 255} }},
|
||||
{{ {-9, 2, 0}, 0, {208, -16}, {134, 37, 0, 255} }},
|
||||
{{ {-8, 3, 0}, 0, {176, -16}, {134, 37, 0, 255} }},
|
||||
{{ {-8, 3, -194}, 0, {176, 496}, {134, 37, 0, 255} }},
|
||||
{{ {-8, 3, -194}, 0, {176, 496}, {144, 60, 0, 255} }},
|
||||
{{ {-8, 3, 0}, 0, {176, -16}, {144, 60, 0, 255} }},
|
||||
{{ {-7, 5, 0}, 0, {144, -16}, {144, 60, 0, 255} }},
|
||||
{{ {-7, 5, -194}, 0, {144, 496}, {144, 60, 0, 255} }},
|
||||
{{ {-7, 5, -194}, 0, {144, 496}, {158, 81, 0, 255} }},
|
||||
{{ {-7, 5, 0}, 0, {144, -16}, {158, 81, 0, 255} }},
|
||||
{{ {-6, 6, 0}, 0, {112, -16}, {158, 81, 0, 255} }},
|
||||
{{ {-6, 6, -194}, 0, {112, 496}, {158, 81, 0, 255} }},
|
||||
{{ {-6, 6, -194}, 0, {112, 496}, {175, 98, 0, 255} }},
|
||||
{{ {-6, 6, 0}, 0, {112, -16}, {175, 98, 0, 255} }},
|
||||
{{ {-5, 7, 0}, 0, {80, -16}, {175, 98, 0, 255} }},
|
||||
{{ {-5, 7, -194}, 0, {80, 496}, {175, 98, 0, 255} }},
|
||||
{{ {-5, 7, -194}, 0, {80, 496}, {196, 112, 0, 255} }},
|
||||
{{ {-5, 7, 0}, 0, {80, -16}, {196, 112, 0, 255} }},
|
||||
{{ {-3, 8, 0}, 0, {48, -16}, {196, 112, 0, 255} }},
|
||||
{{ {-3, 8, -194}, 0, {48, 496}, {196, 112, 0, 255} }},
|
||||
{{ {3, 8, 0}, 0, {334, 525}, {0, 0, 127, 255} }},
|
||||
{{ {2, 9, 0}, 0, {288, 511}, {0, 0, 127, 255} }},
|
||||
{{ {0, 9, 0}, 0, {240, 506}, {0, 0, 127, 255} }},
|
||||
{{ {-3, 8, 0}, 0, {146, 525}, {0, 0, 127, 255} }},
|
||||
{{ {-2, 9, 0}, 0, {192, 511}, {0, 0, 127, 255} }},
|
||||
{{ {-8, 3, 0}, 0, {13, 658}, {0, 0, 127, 255} }},
|
||||
{{ {-6, 6, 0}, 0, {66, 578}, {0, 0, 127, 255} }},
|
||||
{{ {-5, 7, 0}, 0, {103, 548}, {0, 0, 127, 255} }},
|
||||
{{ {-7, 5, 0}, 0, {36, 615}, {0, 0, 127, 255} }},
|
||||
{{ {-9, 2, 0}, 0, {-1, 704}, {0, 0, 127, 255} }},
|
||||
{{ {-9, 0, 0}, 0, {-6, 752}, {0, 0, 127, 255} }},
|
||||
{{ {-8, -3, 0}, 0, {13, 846}, {0, 0, 127, 255} }},
|
||||
{{ {-9, -2, 0}, 0, {-1, 800}, {0, 0, 127, 255} }},
|
||||
{{ {-3, -8, 0}, 0, {146, 979}, {0, 0, 127, 255} }},
|
||||
{{ {-6, -6, 0}, 0, {66, 926}, {0, 0, 127, 255} }},
|
||||
{{ {-7, -5, 0}, 0, {36, 889}, {0, 0, 127, 255} }},
|
||||
{{ {-5, -7, 0}, 0, {103, 956}, {0, 0, 127, 255} }},
|
||||
{{ {-2, -9, 0}, 0, {192, 993}, {0, 0, 127, 255} }},
|
||||
{{ {0, -9, 0}, 0, {240, 998}, {0, 0, 127, 255} }},
|
||||
{{ {3, -8, 0}, 0, {334, 979}, {0, 0, 127, 255} }},
|
||||
{{ {2, -9, 0}, 0, {288, 993}, {0, 0, 127, 255} }},
|
||||
{{ {8, -3, 0}, 0, {467, 846}, {0, 0, 127, 255} }},
|
||||
{{ {6, -6, 0}, 0, {414, 926}, {0, 0, 127, 255} }},
|
||||
{{ {5, -7, 0}, 0, {377, 956}, {0, 0, 127, 255} }},
|
||||
{{ {7, -5, 0}, 0, {444, 889}, {0, 0, 127, 255} }},
|
||||
{{ {9, -2, 0}, 0, {481, 800}, {0, 0, 127, 255} }},
|
||||
{{ {9, 0, 0}, 0, {486, 752}, {0, 0, 127, 255} }},
|
||||
{{ {8, 3, 0}, 0, {467, 658}, {0, 0, 127, 255} }},
|
||||
{{ {9, 2, 0}, 0, {481, 704}, {0, 0, 127, 255} }},
|
||||
{{ {6, 6, 0}, 0, {414, 578}, {0, 0, 127, 255} }},
|
||||
{{ {7, 5, 0}, 0, {444, 615}, {0, 0, 127, 255} }},
|
||||
{{ {5, 7, 0}, 0, {377, 548}, {0, 0, 127, 255} }},
|
||||
{{ {-3, 8, -194}, 0, {48, 496}, {219, 122, 0, 255} }},
|
||||
{{ {-3, 8, 0}, 0, {48, -16}, {219, 122, 0, 255} }},
|
||||
{{ {-2, 9, 0}, 0, {16, -16}, {219, 122, 0, 255} }},
|
||||
{{ {-2, 9, -194}, 0, {16, 496}, {219, 122, 0, 255} }},
|
||||
{{ {-2, 9, -194}, 0, {16, 496}, {244, 126, 0, 255} }},
|
||||
{{ {-2, 9, 0}, 0, {16, -16}, {244, 126, 0, 255} }},
|
||||
{{ {0, 9, 0}, 0, {-16, -16}, {244, 126, 0, 255} }},
|
||||
{{ {0, 9, -194}, 0, {-16, 496}, {244, 126, 0, 255} }},
|
||||
{{ {-2, 9, -194}, 0, {704, 511}, {0, 0, 129, 255} }},
|
||||
{{ {0, 9, -194}, 0, {752, 506}, {0, 0, 129, 255} }},
|
||||
{{ {2, 9, -194}, 0, {800, 511}, {0, 0, 129, 255} }},
|
||||
{{ {5, 7, -194}, 0, {889, 548}, {0, 0, 129, 255} }},
|
||||
{{ {3, 8, -194}, 0, {846, 525}, {0, 0, 129, 255} }},
|
||||
{{ {9, 2, -194}, 0, {993, 704}, {0, 0, 129, 255} }},
|
||||
{{ {7, 5, -194}, 0, {956, 615}, {0, 0, 129, 255} }},
|
||||
{{ {6, 6, -194}, 0, {926, 578}, {0, 0, 129, 255} }},
|
||||
{{ {8, 3, -194}, 0, {979, 658}, {0, 0, 129, 255} }},
|
||||
{{ {9, 0, -194}, 0, {998, 752}, {0, 0, 129, 255} }},
|
||||
{{ {9, -2, -194}, 0, {993, 800}, {0, 0, 129, 255} }},
|
||||
{{ {7, -5, -194}, 0, {956, 889}, {0, 0, 129, 255} }},
|
||||
{{ {8, -3, -194}, 0, {979, 846}, {0, 0, 129, 255} }},
|
||||
{{ {2, -9, -194}, 0, {800, 993}, {0, 0, 129, 255} }},
|
||||
{{ {5, -7, -194}, 0, {889, 956}, {0, 0, 129, 255} }},
|
||||
{{ {6, -6, -194}, 0, {926, 926}, {0, 0, 129, 255} }},
|
||||
{{ {3, -8, -194}, 0, {846, 979}, {0, 0, 129, 255} }},
|
||||
{{ {0, -9, -194}, 0, {752, 998}, {0, 0, 129, 255} }},
|
||||
{{ {-2, -9, -194}, 0, {704, 993}, {0, 0, 129, 255} }},
|
||||
{{ {-5, -7, -194}, 0, {615, 956}, {0, 0, 129, 255} }},
|
||||
{{ {-3, -8, -194}, 0, {658, 979}, {0, 0, 129, 255} }},
|
||||
{{ {-9, -2, -194}, 0, {511, 800}, {0, 0, 129, 255} }},
|
||||
{{ {-7, -5, -194}, 0, {548, 889}, {0, 0, 129, 255} }},
|
||||
{{ {-6, -6, -194}, 0, {578, 926}, {0, 0, 129, 255} }},
|
||||
{{ {-7, -5, -194}, 0, {548, 889}, {0, 0, 129, 255} }},
|
||||
{{ {-8, -3, -194}, 0, {525, 846}, {0, 0, 129, 255} }},
|
||||
{{ {-9, -2, -194}, 0, {511, 800}, {0, 0, 129, 255} }},
|
||||
{{ {-9, 0, -194}, 0, {506, 752}, {0, 0, 129, 255} }},
|
||||
{{ {-9, 2, -194}, 0, {511, 704}, {0, 0, 129, 255} }},
|
||||
{{ {-7, 5, -194}, 0, {548, 615}, {0, 0, 129, 255} }},
|
||||
{{ {-8, 3, -194}, 0, {525, 658}, {0, 0, 129, 255} }},
|
||||
{{ {-2, 9, -194}, 0, {704, 511}, {0, 0, 129, 255} }},
|
||||
{{ {-5, 7, -194}, 0, {615, 548}, {0, 0, 129, 255} }},
|
||||
{{ {-6, 6, -194}, 0, {578, 578}, {0, 0, 129, 255} }},
|
||||
{{ {-3, 8, -194}, 0, {658, 525}, {0, 0, 129, 255} }},
|
||||
{{ {9, 2, -194}, 0, {993, 704}, {0, 0, 129, 255} }},
|
||||
{{ {2, -9, -194}, 0, {800, 993}, {0, 0, 129, 255} }},
|
||||
{{ {-4, -21, -194}, 0, {704, 511}, {0, 0, 127, 255} }},
|
||||
{{ {0, -22, -194}, 0, {752, 506}, {0, 0, 127, 255} }},
|
||||
{{ {4, -21, -194}, 0, {800, 511}, {0, 0, 127, 255} }},
|
||||
{{ {12, -18, -194}, 0, {889, 548}, {0, 0, 127, 255} }},
|
||||
{{ {8, -20, -194}, 0, {846, 525}, {0, 0, 127, 255} }},
|
||||
{{ {21, -4, -194}, 0, {993, 704}, {0, 0, 127, 255} }},
|
||||
{{ {18, -12, -194}, 0, {956, 615}, {0, 0, 127, 255} }},
|
||||
{{ {15, -15, -194}, 0, {926, 578}, {0, 0, 127, 255} }},
|
||||
{{ {20, -8, -194}, 0, {979, 658}, {0, 0, 127, 255} }},
|
||||
{{ {22, 0, -194}, 0, {998, 752}, {0, 0, 127, 255} }},
|
||||
{{ {21, 4, -194}, 0, {993, 800}, {0, 0, 127, 255} }},
|
||||
{{ {18, 12, -194}, 0, {956, 889}, {0, 0, 127, 255} }},
|
||||
{{ {20, 8, -194}, 0, {979, 846}, {0, 0, 127, 255} }},
|
||||
{{ {4, 21, -194}, 0, {800, 993}, {0, 0, 127, 255} }},
|
||||
{{ {12, 18, -194}, 0, {889, 956}, {0, 0, 127, 255} }},
|
||||
{{ {15, 15, -194}, 0, {926, 926}, {0, 0, 127, 255} }},
|
||||
{{ {8, 20, -194}, 0, {846, 979}, {0, 0, 127, 255} }},
|
||||
{{ {0, 22, -194}, 0, {752, 998}, {0, 0, 127, 255} }},
|
||||
{{ {-4, 21, -194}, 0, {704, 993}, {0, 0, 127, 255} }},
|
||||
{{ {4, 21, -194}, 0, {800, 993}, {0, 0, 127, 255} }},
|
||||
{{ {-4, 21, -194}, 0, {704, 993}, {0, 0, 127, 255} }},
|
||||
{{ {-12, 18, -194}, 0, {615, 956}, {0, 0, 127, 255} }},
|
||||
{{ {-8, 20, -194}, 0, {658, 979}, {0, 0, 127, 255} }},
|
||||
{{ {-21, 4, -194}, 0, {511, 800}, {0, 0, 127, 255} }},
|
||||
{{ {-18, 12, -194}, 0, {548, 889}, {0, 0, 127, 255} }},
|
||||
{{ {-15, 15, -194}, 0, {578, 926}, {0, 0, 127, 255} }},
|
||||
{{ {-20, 8, -194}, 0, {525, 846}, {0, 0, 127, 255} }},
|
||||
{{ {-22, 0, -194}, 0, {506, 752}, {0, 0, 127, 255} }},
|
||||
{{ {-21, -4, -194}, 0, {511, 704}, {0, 0, 127, 255} }},
|
||||
{{ {-18, -12, -194}, 0, {548, 615}, {0, 0, 127, 255} }},
|
||||
{{ {-20, -8, -194}, 0, {525, 658}, {0, 0, 127, 255} }},
|
||||
{{ {-4, -21, -194}, 0, {704, 511}, {0, 0, 127, 255} }},
|
||||
{{ {-12, -18, -194}, 0, {615, 548}, {0, 0, 127, 255} }},
|
||||
{{ {-15, -15, -194}, 0, {578, 578}, {0, 0, 127, 255} }},
|
||||
{{ {-8, -20, -194}, 0, {658, 525}, {0, 0, 127, 255} }},
|
||||
{{ {21, -4, -194}, 0, {993, 704}, {0, 0, 127, 255} }},
|
||||
};
|
||||
Gfx handle_Cylinder_mesh_tri_0[106] = {
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 0, 30, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
|
||||
gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 15, 16, 17, 0),
|
||||
gsSP2Triangles(18, 19, 20, 0, 21, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 27, 28, 29, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 30, 30, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
|
||||
gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 15, 16, 17, 0),
|
||||
gsSP2Triangles(18, 19, 20, 0, 21, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 27, 28, 29, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 60, 30, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
|
||||
gsSP2Triangles(6, 7, 8, 0, 9, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 15, 16, 17, 0),
|
||||
gsSP2Triangles(18, 19, 20, 0, 21, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 27, 28, 29, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 90, 30, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0),
|
||||
gsSP2Triangles(6, 7, 8, 0, 6, 8, 9, 0),
|
||||
gsSP2Triangles(10, 11, 12, 0, 10, 12, 13, 0),
|
||||
gsSP2Triangles(14, 15, 16, 0, 14, 16, 17, 0),
|
||||
gsSP2Triangles(18, 19, 20, 0, 18, 20, 21, 0),
|
||||
gsSP2Triangles(22, 23, 24, 0, 22, 24, 25, 0),
|
||||
gsSP2Triangles(26, 27, 28, 0, 26, 28, 29, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 120, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
|
||||
gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 12, 14, 15, 0),
|
||||
gsSP2Triangles(16, 17, 18, 0, 16, 18, 19, 0),
|
||||
gsSP2Triangles(20, 21, 22, 0, 20, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 24, 26, 27, 0),
|
||||
gsSP2Triangles(28, 29, 30, 0, 28, 30, 31, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 152, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
|
||||
gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 12, 14, 15, 0),
|
||||
gsSP2Triangles(16, 17, 18, 0, 16, 18, 19, 0),
|
||||
gsSP2Triangles(20, 21, 22, 0, 20, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 24, 26, 27, 0),
|
||||
gsSP2Triangles(28, 29, 30, 0, 28, 30, 31, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 184, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
|
||||
gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0),
|
||||
gsSP2Triangles(12, 13, 14, 0, 12, 14, 15, 0),
|
||||
gsSP2Triangles(16, 17, 18, 0, 16, 18, 19, 0),
|
||||
gsSP2Triangles(20, 21, 22, 0, 20, 22, 23, 0),
|
||||
gsSP2Triangles(24, 25, 26, 0, 24, 26, 27, 0),
|
||||
gsSP2Triangles(28, 29, 30, 0, 28, 30, 31, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 216, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(2, 4, 3, 0, 0, 3, 5, 0),
|
||||
gsSP2Triangles(3, 6, 5, 0, 3, 7, 6, 0),
|
||||
gsSP2Triangles(6, 8, 5, 0, 5, 9, 10, 0),
|
||||
gsSP2Triangles(5, 10, 11, 0, 10, 12, 11, 0),
|
||||
gsSP2Triangles(5, 11, 13, 0, 11, 14, 13, 0),
|
||||
gsSP2Triangles(11, 15, 14, 0, 14, 16, 13, 0),
|
||||
gsSP2Triangles(13, 17, 18, 0, 13, 18, 19, 0),
|
||||
gsSP2Triangles(18, 20, 19, 0, 13, 19, 21, 0),
|
||||
gsSP2Triangles(19, 22, 21, 0, 19, 23, 22, 0),
|
||||
gsSP2Triangles(22, 24, 21, 0, 21, 25, 26, 0),
|
||||
gsSP2Triangles(21, 26, 27, 0, 26, 28, 27, 0),
|
||||
gsSP2Triangles(21, 27, 0, 0, 27, 29, 0, 0),
|
||||
gsSP2Triangles(27, 30, 29, 0, 29, 31, 0, 0),
|
||||
gsSP2Triangles(0, 5, 13, 0, 13, 21, 0, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 248, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
|
||||
gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
|
||||
gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0),
|
||||
gsSP2Triangles(10, 12, 11, 0, 8, 11, 13, 0),
|
||||
gsSP2Triangles(11, 14, 13, 0, 11, 15, 14, 0),
|
||||
gsSP2Triangles(14, 16, 13, 0, 13, 17, 18, 0),
|
||||
gsSP2Triangles(13, 18, 19, 0, 18, 20, 19, 0),
|
||||
gsSP2Triangles(13, 19, 21, 0, 19, 22, 21, 0),
|
||||
gsSP2Triangles(19, 23, 22, 0, 22, 24, 21, 0),
|
||||
gsSP2Triangles(21, 25, 26, 0, 21, 26, 27, 0),
|
||||
gsSP2Triangles(26, 28, 27, 0, 21, 27, 29, 0),
|
||||
gsSP2Triangles(27, 30, 29, 0, 27, 31, 30, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 280, 32, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 2, 3, 4, 0),
|
||||
gsSP2Triangles(2, 4, 5, 0, 4, 6, 5, 0),
|
||||
gsSP2Triangles(2, 5, 7, 0, 5, 8, 7, 0),
|
||||
gsSP2Triangles(5, 9, 8, 0, 8, 10, 7, 0),
|
||||
gsSP2Triangles(7, 11, 12, 0, 12, 2, 7, 0),
|
||||
gsSP2Triangles(13, 14, 15, 0, 13, 15, 16, 0),
|
||||
gsSP2Triangles(15, 17, 16, 0, 13, 16, 18, 0),
|
||||
gsSP2Triangles(16, 19, 18, 0, 16, 20, 19, 0),
|
||||
gsSP2Triangles(19, 21, 18, 0, 18, 22, 23, 0),
|
||||
gsSP2Triangles(18, 23, 24, 0, 23, 25, 24, 0),
|
||||
gsSP2Triangles(18, 24, 26, 0, 24, 27, 26, 0),
|
||||
gsSP2Triangles(24, 28, 27, 0, 27, 29, 26, 0),
|
||||
gsSP1Triangle(26, 30, 31, 0),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_0 + 312, 17, 0),
|
||||
gsSP2Triangles(0, 1, 2, 0, 1, 3, 2, 0),
|
||||
gsSP2Triangles(0, 2, 4, 0, 2, 5, 4, 0),
|
||||
gsSP2Triangles(2, 6, 5, 0, 5, 7, 4, 0),
|
||||
gsSP2Triangles(4, 8, 9, 0, 4, 9, 10, 0),
|
||||
gsSP2Triangles(9, 11, 10, 0, 4, 10, 12, 0),
|
||||
gsSP2Triangles(10, 13, 12, 0, 10, 14, 13, 0),
|
||||
gsSP2Triangles(13, 15, 12, 0, 12, 16, 0, 0),
|
||||
gsSP1Triangle(0, 4, 12, 0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx mat_handle_f3dlite_material[9] = {
|
||||
gsSPClearGeometryMode(G_CLIPPING | G_ZBUFFER),
|
||||
//gsSPSetLights1(handle_f3dlite_material_lights),
|
||||
gsDPPipeSync(),
|
||||
gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT),
|
||||
gsDPSetAlphaDither(G_AD_NOISE),
|
||||
gsSPTexture(65535, 65535, 0, 0, 1),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx mat_revert_handle_f3dlite_material[4] = {
|
||||
gsSPSetGeometryMode(G_CLIPPING | G_ZBUFFER),
|
||||
gsDPPipeSync(),
|
||||
gsDPSetAlphaDither(G_AD_DISABLE),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx handle_Cylinder_mesh[13] = {
|
||||
gsSPClearGeometryMode(G_LIGHTING),
|
||||
gsSPVertex(handle_Cylinder_mesh_vtx_cull + 0, 8, 0),
|
||||
gsSPSetGeometryMode(G_LIGHTING),
|
||||
gsSPCullDisplayList(0, 7),
|
||||
gsSPDisplayList(mat_handle_f3dlite_material),
|
||||
gsSPDisplayList(handle_Cylinder_mesh_tri_0),
|
||||
gsSPDisplayList(mat_revert_handle_f3dlite_material),
|
||||
gsDPPipeSync(),
|
||||
gsSPSetGeometryMode(G_LIGHTING),
|
||||
gsSPClearGeometryMode(G_TEXTURE_GEN),
|
||||
gsDPSetCombineLERP(0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT, 0, 0, 0, SHADE, 0, 0, 0, ENVIRONMENT),
|
||||
gsSPTexture(65535, 65535, 0, 0, 0),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <libultraship.h>
|
||||
#include <libultra/gbi.h>
|
||||
|
||||
extern Gfx handle_Cylinder_mesh[];
|
||||
extern Lights1 handle_f3dlite_material_lights;
|
||||
@@ -0,0 +1,75 @@
|
||||
#include <iostream>
|
||||
#include <libultraship.h>
|
||||
#include <libultra/gbi.h>
|
||||
#include "../CoreMath.h"
|
||||
#include <libultra/types.h>
|
||||
#include "../World.h"
|
||||
|
||||
#include "Light.h"
|
||||
#include "port/Engine.h"
|
||||
#include <controller/controldevice/controller/mapping/keyboard/KeyboardScancodes.h>
|
||||
#include <window/Window.h>
|
||||
|
||||
#include "engine/actors/Ship.h"
|
||||
#include "port/Game.h"
|
||||
#include "Gizmo.h"
|
||||
|
||||
#include "EditorMath.h"
|
||||
#include "Handle.h"
|
||||
|
||||
extern "C" {
|
||||
#include "common_structs.h"
|
||||
#include "main.h"
|
||||
#include "defines.h"
|
||||
#include "actors.h"
|
||||
#include "camera.h"
|
||||
#include "math_util.h"
|
||||
#include "math_util_2.h"
|
||||
}
|
||||
|
||||
namespace Editor {
|
||||
|
||||
size_t LightObject::NumLights = 0;
|
||||
|
||||
LightObject::LightObject(const char* name, FVector* pos, s8* direction) : GameObject(nullptr, nullptr) {
|
||||
Name = name;
|
||||
// If pos is nullptr, allocate memory, otherwise assign pos
|
||||
// if (pos != nullptr) {
|
||||
// Pos = pos;
|
||||
// }
|
||||
Pos = &LightPos;
|
||||
Rot = &LightRot;
|
||||
|
||||
// Pos = &LightPos;
|
||||
DespawnFlag = &_despawnFlag;
|
||||
DespawnValue = -1;
|
||||
|
||||
Direction = direction;
|
||||
|
||||
NumLights += 1;
|
||||
}
|
||||
|
||||
void LightObject::Load() {
|
||||
//Pos = &LightPos;
|
||||
}
|
||||
|
||||
void LightObject::Tick() {
|
||||
//Pos = &LightPos;
|
||||
SetDirectionFromRotator(*Rot, Direction);
|
||||
//Direction[0] = static_cast<char>(((*Rot)[0] / 256 - 128) & 0xFF);
|
||||
//Direction[1] = static_cast<char>(((*Rot)[1] / 256 - 128) & 0xFF);
|
||||
//Direction[2] = static_cast<char>(((*Rot)[2] / 256 - 128) & 0xFF);
|
||||
//printf("Light rot %d %d %d %d %d %d\n", Direction[0], Direction[1], Direction[2], (*Rot)[0], (*Rot)[1], (*Rot)[2]);
|
||||
}
|
||||
void LightObject::Draw() {
|
||||
Mat4 mtx;
|
||||
|
||||
Vec3f pos = {Pos->x, Pos->y, Pos->z};
|
||||
Vec3s rot = {(*Rot)[0], (*Rot)[1] + 0x4000, (*Rot)[2]};
|
||||
mtxf_pos_rotation_xyz(mtx, pos, rot);
|
||||
mtxf_scale(mtx, 0.3);
|
||||
Editor_AddMatrix(mtx, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gDisplayListHead++, sun_LightModel_mesh);
|
||||
gSPDisplayList(gDisplayListHead++, handle_Cylinder_mesh);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -23,21 +23,16 @@ extern "C" {
|
||||
#include "camera.h"
|
||||
}
|
||||
|
||||
namespace EditorNamespace {
|
||||
|
||||
ObjectPicker::ObjectPicker() {
|
||||
|
||||
}
|
||||
namespace Editor {
|
||||
|
||||
void ObjectPicker::Load() {
|
||||
eGizmo.Load();
|
||||
}
|
||||
|
||||
void ObjectPicker::Tick() {
|
||||
eGizmo.Tick();
|
||||
}
|
||||
|
||||
void ObjectPicker::SelectObject(std::vector<GameObject>& objects) {
|
||||
void ObjectPicker::SelectObject(std::vector<GameObject*> objects) {
|
||||
Ray ray;
|
||||
ray.Origin = FVector(cameras[0].pos[0], cameras[0].pos[1], cameras[0].pos[2]);
|
||||
|
||||
@@ -67,6 +62,7 @@ void ObjectPicker::DragHandle() {
|
||||
// Skip if a drag is already in progress
|
||||
if (eGizmo.SelectedHandle != Gizmo::GizmoHandle::None) {
|
||||
eGizmo._ray = ray.Direction;
|
||||
eGizmo.Tick();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -126,35 +122,35 @@ void ObjectPicker::Draw() {
|
||||
}
|
||||
}
|
||||
|
||||
void ObjectPicker::FindObject(Ray ray, std::vector<GameObject>& objects) {
|
||||
void ObjectPicker::FindObject(Ray ray, std::vector<GameObject*> objects) {
|
||||
bool found = false;
|
||||
for (auto& object : objects) {
|
||||
float boundingBox = object.BoundingBoxSize;
|
||||
float boundingBox = object->BoundingBoxSize;
|
||||
if (boundingBox == 0.0f) {
|
||||
boundingBox = 2.0f;
|
||||
}
|
||||
|
||||
switch(object.Collision) {
|
||||
case CollisionType::VTX_INTERSECT:
|
||||
for (const auto& tri : object.Triangles) {
|
||||
switch(object->Collision) {
|
||||
case GameObject::CollisionType::VTX_INTERSECT:
|
||||
for (const auto& tri : object->Triangles) {
|
||||
float t;
|
||||
if (IntersectRayTriangle(ray, tri, *object.Pos, t)) {
|
||||
if (IntersectRayTriangle(ray, tri, *object->Pos, t)) {
|
||||
printf("\nSELECTED OBJECT\n\n");
|
||||
_selected = &object;
|
||||
_selected = object;
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CollisionType::BOUNDING_BOX: {
|
||||
case GameObject::CollisionType::BOUNDING_BOX: {
|
||||
float max = 2.0f;
|
||||
float min = -2.0f;
|
||||
Vec3f boxMin = { object.Pos->x + boundingBox * min,
|
||||
object.Pos->y + boundingBox * min,
|
||||
object.Pos->z + boundingBox * min };
|
||||
Vec3f boxMin = { object->Pos->x + boundingBox * min,
|
||||
object->Pos->y + boundingBox * min,
|
||||
object->Pos->z + boundingBox * min };
|
||||
|
||||
Vec3f boxMax = { object.Pos->x + boundingBox * max,
|
||||
object.Pos->y + boundingBox * max,
|
||||
object.Pos->z + boundingBox * max };
|
||||
Vec3f boxMax = { object->Pos->x + boundingBox * max,
|
||||
object->Pos->y + boundingBox * max,
|
||||
object->Pos->z + boundingBox * max };
|
||||
float t;
|
||||
if (QueryCollisionRayActor(&ray.Origin.x, &ray.Direction.x, boxMin, boxMax, &t)) {
|
||||
// if (actor == _selected) {
|
||||
@@ -164,13 +160,13 @@ void ObjectPicker::FindObject(Ray ray, std::vector<GameObject>& objects) {
|
||||
printf("FOUND BOUNDING BOX OBJECT\n");
|
||||
found = true;
|
||||
//foundActor = &actor;
|
||||
//type = object.Type;
|
||||
_selected = &object;
|
||||
//type = object->Type;
|
||||
_selected = object;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CollisionType::BOUNDING_SPHERE:
|
||||
case GameObject::CollisionType::BOUNDING_SPHERE:
|
||||
printf("Editor::ObjectPicker.cpp Bounding sphere collision type not yet supported\n");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4,17 +4,15 @@
|
||||
#include <libultra/gbi.h>
|
||||
#include "Collision.h"
|
||||
#include "Gizmo.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
namespace EditorNamespace {
|
||||
|
||||
class ObjectPicker {
|
||||
namespace Editor {
|
||||
class ObjectPicker {
|
||||
public:
|
||||
ObjectPicker();
|
||||
|
||||
void SelectObject(std::vector<GameObject>& objects);
|
||||
void SelectObject(std::vector<GameObject*> objects);
|
||||
void DragHandle();
|
||||
void Draw();
|
||||
void FindObject(Ray ray, std::vector<GameObject>& objects);
|
||||
void FindObject(Ray ray, std::vector<GameObject*> objects);
|
||||
void Load();
|
||||
void Tick();
|
||||
Gizmo eGizmo;
|
||||
@@ -26,5 +24,5 @@ class ObjectPicker {
|
||||
s32 Inverse(MtxF* src, MtxF* dest);
|
||||
void Copy(MtxF* src, MtxF* dest);
|
||||
void Clear(MtxF* mf);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -798,6 +798,7 @@ void race_logic_loop(void) {
|
||||
ClearMatrixPools();
|
||||
ClearObjectsMatrixPool();
|
||||
ClearEffectsMatrixPool();
|
||||
Editor_ClearMatrix();
|
||||
gMatrixObjectCount = 0;
|
||||
gMatrixEffectCount = 0;
|
||||
|
||||
|
||||
+12
-1
@@ -102,7 +102,7 @@ ModelLoader gModelLoader;
|
||||
|
||||
HarbourMastersIntro gMenuIntro;
|
||||
|
||||
EditorNamespace::Editor gEditor;
|
||||
Editor::Editor gEditor;
|
||||
|
||||
s32 gTrophyIndex = NULL;
|
||||
|
||||
@@ -387,6 +387,7 @@ void CM_BeginPlay() {
|
||||
gWorldInstance.AddActor(new AFinishline(course->FinishlineSpawnPoint));
|
||||
}
|
||||
|
||||
gEditor.AddLight("Sun", nullptr, D_800DC610[1].l->l.dir);
|
||||
course->BeginPlay();
|
||||
}
|
||||
}
|
||||
@@ -689,6 +690,16 @@ void CM_AddEditorObject(struct Actor* actor, const char* name) {
|
||||
gWorldInstance.AddEditorObject(actor, name);
|
||||
}
|
||||
|
||||
void Editor_AddLight(s8* direction) {
|
||||
static size_t i = 0;
|
||||
gEditor.AddLight(("Light "+std::to_string(i)).c_str(), nullptr, direction);
|
||||
i += 1;
|
||||
}
|
||||
|
||||
void Editor_ClearMatrix() {
|
||||
gEditor.ClearMatrixPool();
|
||||
}
|
||||
|
||||
size_t CM_GetActorSize() {
|
||||
return gWorldInstance.Actors.size();
|
||||
}
|
||||
|
||||
+3
-1
@@ -16,7 +16,7 @@ extern "C" {
|
||||
extern s32 gTrophyIndex;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern EditorNamespace::Editor gEditor;
|
||||
extern Editor::Editor gEditor;
|
||||
#endif
|
||||
|
||||
Properties* CM_GetProps();
|
||||
@@ -72,6 +72,7 @@ void CM_DrawObjects(s32 cameraId);
|
||||
|
||||
void CM_TickEditor();
|
||||
void CM_TickDraw();
|
||||
void Editor_ClearMatrix();
|
||||
|
||||
void CM_TickParticles(void);
|
||||
void CM_DrawParticles(s32 cameraId);
|
||||
@@ -144,6 +145,7 @@ struct Actor* CM_GetActor(size_t index);
|
||||
void CM_DeleteActor(size_t index);
|
||||
struct Actor* CM_AddBaseActor();
|
||||
void CM_AddEditorObject(struct Actor* actor, const char* name);
|
||||
void Editor_AddLight(s8* direction);
|
||||
size_t CM_GetActorSize();
|
||||
size_t CM_FindActorIndex(struct Actor* actor);
|
||||
void CM_ActorCollision(Player* player, struct Actor* actor);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <common_structs.h>
|
||||
#include <defines.h>
|
||||
|
||||
namespace EditorNamespace {
|
||||
namespace Editor {
|
||||
|
||||
ContentBrowserWindow::~ContentBrowserWindow() {
|
||||
SPDLOG_TRACE("destruct content browser window");
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <libultraship/libultraship.h>
|
||||
|
||||
namespace EditorNamespace {
|
||||
namespace Editor {
|
||||
class ContentBrowserWindow : public Ship::GuiWindow {
|
||||
public:
|
||||
using Ship::GuiWindow::GuiWindow;
|
||||
|
||||
@@ -81,18 +81,18 @@ void SetupGuiElements() {
|
||||
SPDLOG_ERROR("Could not find input GfxDebuggerWindow");
|
||||
}
|
||||
|
||||
mToolsWindow = std::make_shared<EditorNamespace::ToolsWindow>("gEditorEnabled", true, "Tools", ImVec2(100, 100),
|
||||
mToolsWindow = std::make_shared<Editor::ToolsWindow>("gEditorEnabled", true, "Tools", ImVec2(100, 100),
|
||||
(ImGuiWindowFlags_NoTitleBar));
|
||||
gui->AddGuiWindow(mToolsWindow);
|
||||
|
||||
mSceneExplorerWindow = std::make_shared<EditorNamespace::SceneExplorerWindow>("gEditorEnabled", "Scene Explorer");
|
||||
mSceneExplorerWindow = std::make_shared<Editor::SceneExplorerWindow>("gEditorEnabled", "Scene Explorer");
|
||||
gui->AddGuiWindow(mSceneExplorerWindow);
|
||||
|
||||
mTrackPropertiesWindow = std::make_shared<EditorNamespace::TrackPropertiesWindow>("gEditorEnabled", "Track Properties");
|
||||
mTrackPropertiesWindow = std::make_shared<Editor::TrackPropertiesWindow>("gEditorEnabled", "Track Properties");
|
||||
gui->AddGuiWindow(mTrackPropertiesWindow);
|
||||
|
||||
mContentBrowserWindow =
|
||||
std::make_shared<EditorNamespace::ContentBrowserWindow>("gEditorEnabled", "Content Browser");
|
||||
std::make_shared<Editor::ContentBrowserWindow>("gEditorEnabled", "Content Browser");
|
||||
gui->AddGuiWindow(mContentBrowserWindow);
|
||||
|
||||
mGameInfoWindow = std::make_shared<GameInfo::GameInfoWindow>("gGameInfoEnabled", "Game Info");
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include "engine/editor/Editor.h"
|
||||
#include "port/Game.h"
|
||||
|
||||
namespace EditorNamespace {
|
||||
namespace Editor {
|
||||
|
||||
SceneExplorerWindow::~SceneExplorerWindow() {
|
||||
SPDLOG_TRACE("destruct scene explorer window");
|
||||
@@ -26,13 +26,13 @@ namespace EditorNamespace {
|
||||
size_t id = 0; // id for now because we don't have unique names atm
|
||||
for (auto& object : gEditor.eGameObjects) {
|
||||
// Convert const char* to std::string before formatting
|
||||
std::string objectName = object.Name ? object.Name : "Obj";
|
||||
std::string objectName = object->Name ? object->Name : "Obj";
|
||||
|
||||
// Ensure unique label using index
|
||||
std::string label = fmt::format("{}##{}", objectName, id);
|
||||
|
||||
if (ImGui::Button(label.c_str())) {
|
||||
gEditor.SelectObjectFromSceneExplorer(&object);
|
||||
gEditor.SelectObjectFromSceneExplorer(object);
|
||||
}
|
||||
id += 1;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "port/Game.h"
|
||||
|
||||
|
||||
namespace EditorNamespace {
|
||||
namespace Editor {
|
||||
class SceneExplorerWindow : public Ship::GuiWindow {
|
||||
public:
|
||||
using Ship::GuiWindow::GuiWindow;
|
||||
|
||||
+25
-24
@@ -16,7 +16,7 @@ extern "C" {
|
||||
#include "code_80057C60.h"
|
||||
}
|
||||
|
||||
namespace EditorNamespace {
|
||||
namespace Editor {
|
||||
|
||||
ToolsWindow::~ToolsWindow() {
|
||||
SPDLOG_TRACE("destruct tools window");
|
||||
@@ -38,25 +38,27 @@ namespace EditorNamespace {
|
||||
bool isSelected = (selectedTool == id);
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, isSelected ? ImVec4(0.4f, 0.7f, 0.9f, 1.0f) : defaultColor);
|
||||
|
||||
if (ImGui::Button(label, ImVec2(125, 25))) {
|
||||
if (ImGui::Button(label, ImVec2(50, 25))) {
|
||||
selectedTool = id; // Set the selected tool
|
||||
CVarSetInteger("eGizmoMode", id);
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor();
|
||||
};
|
||||
|
||||
// Draw buttons
|
||||
ToolButton("Move", 0);
|
||||
ToolButton(ICON_FA_ARROWS, 0);
|
||||
ImGui::SameLine();
|
||||
ToolButton("Rotate", 1);
|
||||
ToolButton(ICON_FA_REPEAT, 1);
|
||||
ImGui::SameLine();
|
||||
ToolButton("Scale", 2);
|
||||
ToolButton(ICON_FA_EXPAND, 2);
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
// Snap to ground
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, toggleGroundSnap ? ImVec4(0.4f, 0.7f, 0.9f, 1.0f) : defaultColor);
|
||||
if (ImGui::Button(toggleGroundSnap ? "SNAP TO GROUND" : "SNAP TO GROUND", ImVec2(125, 25))) {
|
||||
|
||||
if (ImGui::Button(ICON_FA_LINK, ImVec2(50, 25))) {
|
||||
toggleGroundSnap = !toggleGroundSnap;
|
||||
|
||||
CVarSetInteger("gEditorSnapToGround", toggleGroundSnap);
|
||||
@@ -76,38 +78,37 @@ namespace EditorNamespace {
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
|
||||
if (ImGui::Button("Player One AI/Human", ImVec2(160, 25))) {
|
||||
if (gPlayerOne->type & PLAYER_KART_AI) {
|
||||
// Toggle player human/ai
|
||||
bool playerToggle = (gPlayerOne->type & PLAYER_KART_AI);
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, defaultColor);
|
||||
if (ImGui::Button(playerToggle ? ICON_FA_DESKTOP : ICON_FA_GAMEPAD, ImVec2(50, 25))) {
|
||||
if (playerToggle) {
|
||||
gPlayerOne->type &= ~PLAYER_KART_AI;
|
||||
} else {
|
||||
gPlayerOne->type |= PLAYER_KART_AI;
|
||||
}
|
||||
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
auto PlayButton = [&](const char* label, int id) {
|
||||
bool isSelected = (selectedPlayTool == id);
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, isSelected ? ImVec4(0.4f, 0.7f, 0.9f, 1.0f) : defaultColor);
|
||||
|
||||
if (ImGui::Button(label, ImVec2(125, 25))) {
|
||||
selectedPlayTool = id; // Set the selected tool
|
||||
gIsEditorPaused = (id == 1);
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor();
|
||||
};
|
||||
// Play/pause button
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, defaultColor);
|
||||
if (ImGui::Button(gIsEditorPaused ? ICON_FA_PLAY : ICON_FA_PAUSE, ImVec2(50, 25))) {
|
||||
|
||||
// Draw buttons
|
||||
PlayButton("Play", 0);
|
||||
ImGui::SameLine();
|
||||
PlayButton("Pause", 1);
|
||||
gIsEditorPaused = !gIsEditorPaused;
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
// Toggle hud
|
||||
ImGui::PushStyleColor(ImGuiCol_Button, gIsHUDVisible ? ImVec4(0.4f, 0.7f, 0.9f, 1.0f) : defaultColor);
|
||||
if (ImGui::Button("Toggle HUD", ImVec2(150, 25))) {
|
||||
|
||||
gIsHUDVisible = !gIsHUDVisible;
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <libultraship/libultraship.h>
|
||||
|
||||
namespace EditorNamespace {
|
||||
namespace Editor {
|
||||
class ToolsWindow : public Ship::GuiWindow {
|
||||
public:
|
||||
using Ship::GuiWindow::GuiWindow;
|
||||
|
||||
@@ -20,7 +20,7 @@ extern "C" {
|
||||
#include "render_courses.h"
|
||||
}
|
||||
|
||||
namespace EditorNamespace {
|
||||
namespace Editor {
|
||||
|
||||
TrackPropertiesWindow::~TrackPropertiesWindow() {
|
||||
SPDLOG_TRACE("destruct track properties window");
|
||||
|
||||
@@ -6,7 +6,7 @@ extern "C" {
|
||||
#include "sounds.h"
|
||||
}
|
||||
|
||||
namespace EditorNamespace {
|
||||
namespace Editor {
|
||||
class TrackPropertiesWindow : public Ship::GuiWindow {
|
||||
public:
|
||||
using Ship::GuiWindow::GuiWindow;
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "math.h"
|
||||
#include "memory.h"
|
||||
#include "engine/Matrix.h"
|
||||
#include "port/Game.h"
|
||||
|
||||
#pragma intrinsic(sqrtf, fabs)
|
||||
|
||||
@@ -441,7 +442,7 @@ void set_track_light_direction(Lights1* addr, s16 pitch, s16 yaw, s32 numLights)
|
||||
s32 var_v0;
|
||||
s8 sp2C[3];
|
||||
Lights1* var_s0;
|
||||
return;
|
||||
|
||||
var_s0 = (Lights1*) addr;
|
||||
sp48 = sins(yaw);
|
||||
sp44 = coss(yaw);
|
||||
|
||||
Reference in New Issue
Block a user