Skip to content

Commit

Permalink
Add deploy params
Browse files Browse the repository at this point in the history
  • Loading branch information
Namide committed Jan 14, 2024
1 parent b0d5a8b commit 6d6ad85
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 38 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Install
run: npm install

- name: Type check
run: npm run type

- name: Lint
run: npm run lint

- name: Build
run: npm run pages

- name: Upload
uses: actions/upload-pages-artifact@v2
with:
path: './dist'

- name: Deploy
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"noForEach": "off"
}
},
"ignore": ["./src/engine/physic/havok/*"],
"include": ["./*"]
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "vite --host",
"build": "vite build",
"pages": "BASE=/havok-test-2/ vite build",
"type": "tsc",
"preview": "vite preview --host --port 5173",
"lint": "biome lint ./src",
Expand Down
21 changes: 1 addition & 20 deletions src/elements/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { PlayerRender } from "../engine/render/PlayerRender";
export class Player {
world: World
group = new THREE.Group()
// capsule: RenderElement<ShapeType.Capsule>
render: PlayerRender
physic: PhysicElement<ShapeType.Capsule>
controller: Controller
Expand All @@ -21,7 +20,6 @@ export class Player {

constructor({
world,
texture,
position,
rotation = [0, 0, 0, 1],
}: {
Expand All @@ -41,26 +39,9 @@ export class Player {

this.controller = new Controller({})

this.render = new PlayerRender({
world,
texture,
position,
rotation
})
this.render = new PlayerRender({ world })
this.group.add(this.render.mesh)

// this.capsule = new RenderElement({
// world,
// texture,
// position,
// shape: ShapeType.Capsule,
// size,
// rotation
// })
// this.capsule.mesh.position.set(0, 0, 0)
// this.capsule.mesh.quaternion.set(0, 0, 0, 1)
// this.group.add(this.capsule.mesh)

this.physic = new PhysicElement({
world,
position,
Expand Down
10 changes: 1 addition & 9 deletions src/engine/render/PlayerRender.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as THREE from "three";
import { SHADOW } from "../../config";
import { World } from "../../elements/World";
import { Quaternion, Vector3 } from "../physic/havok/HavokPhysics";
import { GLTF, GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
import { loadGLTF } from "./loadGLTF";

Expand All @@ -21,17 +20,10 @@ export class PlayerRender {
}

constructor(
{ world, texture, position, rotation }:
{ world: World, texture: THREE.Texture, position: Vector3, rotation: Quaternion }
{ world }: { world: World }
) {
this.world = world

// const material = new (
// SHADOW ? THREE.MeshLambertMaterial : THREE.MeshBasicMaterial
// )({
// map: texture,
// });

loadGLTF('assets/cosmonaut.glb')
.then(gltf => {
gltf
Expand Down
2 changes: 1 addition & 1 deletion src/engine/render/RenderBox.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as THREE from "three";
import { SHADOW } from "../../config";
import { World } from "../elements/World";
import { Quaternion, Vector3 } from "../physic/havok/HavokPhysics";
import { World } from "../../elements/World";

export class RenderBox {
world: World
Expand Down
9 changes: 1 addition & 8 deletions src/engine/render/RenderWorld.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as THREE from "three";
import { OrbitControls } from "three/examples/jsm/Addons.js";
import { CAMERA_FOLLOW, CAMERA_POSITION, ORBIT_CONTROL } from "../../config";
import { ShadowLight } from "../render/ShadowLight";
import { matrix4, vector3 } from "../../constants";
import { vector3 } from "../../constants";
import { getBottomIntersect } from "./getIntersect";

// Soft shadows
Expand Down Expand Up @@ -81,13 +81,6 @@ export class RenderWorld {
}
}

// testFrustrumCulling(object: THREE.Object3D, updateFrustrum = false) {
// if (updateFrustrum) {
// this.frustrum.setFromProjectionMatrix(matrix4.multiplyMatrices(this.camera.projectionMatrix, this.camera.matrixWorldInverse))
// }
// return this.frustrum.intersectsObject(object)
// }

render(center?: THREE.Object3D, ground?: THREE.Group, smooth = true) {
if (center && ground) {

Expand Down

0 comments on commit 6d6ad85

Please sign in to comment.