Skip to content

Commit

Permalink
Merge branch 'deploy' into feat/#50-multiplay
Browse files Browse the repository at this point in the history
  • Loading branch information
leewooseong committed May 18, 2024
2 parents b779534 + ff7209d commit 6c5c512
Show file tree
Hide file tree
Showing 21 changed files with 137,365 additions and 128,638 deletions.
27 changes: 27 additions & 0 deletions frontend/Custom-model0.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Auto-generated by: https://github.com/pmndrs/gltfjsx
Command: npx [email protected] public/models/custom/custom-model0.gltf
*/

import React, { useRef } from 'react'
import { useGLTF, useAnimations } from '@react-three/drei'

export function Model(props) {
const group = useRef()
const { nodes, materials, animations } = useGLTF('/custom-model0.gltf')
const { actions } = useAnimations(animations, group)
return (
<group ref={group} {...props} dispose={null}>
<group name="Scene">
<group name="MyCharacter" scale={0.64}>
<primitive object={nodes.LeftFootCtrl} />
<primitive object={nodes.RightFootCtrl} />
<primitive object={nodes.HipsCtrl} />
<skinnedMesh name="characterMedium" geometry={nodes.characterMedium.geometry} material={materials['skin.001']} skeleton={nodes.characterMedium.skeleton} />
</group>
</group>
</group>
)
}

useGLTF.preload('/custom-model0.gltf')
27 changes: 27 additions & 0 deletions frontend/Custom-model1.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Auto-generated by: https://github.com/pmndrs/gltfjsx
Command: npx [email protected] public/models/custom/custom-model1.gltf
*/

import React, { useRef } from 'react'
import { useGLTF, useAnimations } from '@react-three/drei'

export function Model(props) {
const group = useRef()
const { nodes, materials, animations } = useGLTF('/custom-model1.gltf')
const { actions } = useAnimations(animations, group)
return (
<group ref={group} {...props} dispose={null}>
<group name="Scene">
<group name="MyCharacter" scale={0.64}>
<primitive object={nodes.LeftFootCtrl} />
<primitive object={nodes.RightFootCtrl} />
<primitive object={nodes.HipsCtrl} />
<skinnedMesh name="characterMedium" geometry={nodes.characterMedium.geometry} material={materials['skin.001']} skeleton={nodes.characterMedium.skeleton} />
</group>
</group>
</group>
)
}

useGLTF.preload('/custom-model1.gltf')
27 changes: 27 additions & 0 deletions frontend/Custom-model2.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Auto-generated by: https://github.com/pmndrs/gltfjsx
Command: npx [email protected] public/models/custom/custom-model2.gltf
*/

import React, { useRef } from 'react'
import { useGLTF, useAnimations } from '@react-three/drei'

export function Model(props) {
const group = useRef()
const { nodes, materials, animations } = useGLTF('/custom-model2.gltf')
const { actions } = useAnimations(animations, group)
return (
<group ref={group} {...props} dispose={null}>
<group name="Scene">
<group name="MyCharacter">
<primitive object={nodes.LeftFootCtrl} />
<primitive object={nodes.RightFootCtrl} />
<primitive object={nodes.HipsCtrl} />
<skinnedMesh name="characterMedium" geometry={nodes.characterMedium.geometry} material={materials['skin.001']} skeleton={nodes.characterMedium.skeleton} />
</group>
</group>
</group>
)
}

useGLTF.preload('/custom-model2.gltf')
27 changes: 27 additions & 0 deletions frontend/Custom-model3.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Auto-generated by: https://github.com/pmndrs/gltfjsx
Command: npx [email protected] public/models/custom/custom-model3.gltf
*/

import React, { useRef } from 'react'
import { useGLTF, useAnimations } from '@react-three/drei'

export function Model(props) {
const group = useRef()
const { nodes, materials, animations } = useGLTF('/custom-model3.gltf')
const { actions } = useAnimations(animations, group)
return (
<group ref={group} {...props} dispose={null}>
<group name="Scene">
<group name="MyCharacter">
<primitive object={nodes.LeftFootCtrl} />
<primitive object={nodes.RightFootCtrl} />
<primitive object={nodes.HipsCtrl} />
<skinnedMesh name="characterMedium" geometry={nodes.characterMedium.geometry} material={materials['skin.001']} skeleton={nodes.characterMedium.skeleton} />
</group>
</group>
</group>
)
}

useGLTF.preload('/custom-model3.gltf')
27 changes: 27 additions & 0 deletions frontend/Custom-model4.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Auto-generated by: https://github.com/pmndrs/gltfjsx
Command: npx [email protected] public/models/custom/custom-model4.gltf
*/

import React, { useRef } from 'react'
import { useGLTF, useAnimations } from '@react-three/drei'

export function Model(props) {
const group = useRef()
const { nodes, materials, animations } = useGLTF('/custom-model4.gltf')
const { actions } = useAnimations(animations, group)
return (
<group ref={group} {...props} dispose={null}>
<group name="Scene">
<group name="MyCharacter" scale={0.64}>
<primitive object={nodes.LeftFootCtrl} />
<primitive object={nodes.RightFootCtrl} />
<primitive object={nodes.HipsCtrl} />
<skinnedMesh name="characterMedium" geometry={nodes.characterMedium.geometry} material={materials['skin.001']} skeleton={nodes.characterMedium.skeleton} />
</group>
</group>
</group>
)
}

useGLTF.preload('/custom-model4.gltf')
27 changes: 27 additions & 0 deletions frontend/Custom-model5.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Auto-generated by: https://github.com/pmndrs/gltfjsx
Command: npx [email protected] public/models/character-select/custom-model5.gltf
*/

import React, { useRef } from 'react'
import { useGLTF, useAnimations } from '@react-three/drei'

export function Model(props) {
const group = useRef()
const { nodes, materials, animations } = useGLTF('/custom-model5.gltf')
const { actions } = useAnimations(animations, group)
return (
<group ref={group} {...props} dispose={null}>
<group name="Scene">
<group name="Male" scale={0.64}>
<primitive object={nodes.LeftFootCtrl} />
<primitive object={nodes.RightFootCtrl} />
<primitive object={nodes.HipsCtrl} />
<skinnedMesh name="characterMedium" geometry={nodes.characterMedium.geometry} material={materials['skin.001']} skeleton={nodes.characterMedium.skeleton} />
</group>
</group>
</group>
)
}

useGLTF.preload('/custom-model5.gltf')
27 changes: 21 additions & 6 deletions frontend/app/(page)/(needProtection)/game/component/Character.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@ import { teamEnum } from '../lib/store-type'
import { useAuth } from '@/app/hooks/useAuth'
import { useFrame, useThree } from '@react-three/fiber'

const modelPaths = [
'/models/custom/custom-model0.gltf',
'/models/custom/custom-model1.gltf',
'/models/custom/custom-model2.gltf',
'/models/custom/custom-model3.gltf',
'/models/custom/custom-model4.gltf',
'/models/custom/custom-model5.gltf',
]

export default function Character({ pos }) {
const groupRef = useRef()
const { userInfo } = useAuth()
const { characterIndex } = useCharacterSelectStore()

const { nodes, animations, scene } = useGLTF(`/models/custom/custom-model${characterIndex}.gltf`)
const { nodes, animations, scene } = useGLTF(modelPaths[characterIndex])
const { actions } = useAnimations(animations, scene)

const { playerMoveState, playerTeamState } = usePlayerStore((state) => ({
Expand Down Expand Up @@ -61,11 +70,17 @@ export default function Character({ pos }) {
<primitive object={scene} />
<Text
ref={textRef}
position={[0, 3, 0]} // ์บ๋ฆญํ„ฐ์˜ ๋จธ๋ฆฌ ์œ„ ์ ์ ˆํ•œ ์œ„์น˜์— ๋‹‰๋„ค์ž„์„ ๋ฐฐ์น˜ํ•ฉ๋‹ˆ๋‹ค.
fontSize={0.5} // ํฐํŠธ ํฌ๊ธฐ๋ฅผ ์กฐ์ ˆํ•ฉ๋‹ˆ๋‹ค.
color="black" // ํ…์ŠคํŠธ ์ƒ‰์ƒ์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.
anchorX="center" // ํ…์ŠคํŠธ๋ฅผ ์ค‘์•™ ์ •๋ ฌํ•ฉ๋‹ˆ๋‹ค.
anchorY="bottom" // ํ…์ŠคํŠธ์˜ ํ•˜๋‹จ์„ ๊ธฐ์ค€์œผ๋กœ ์œ„์น˜๋ฅผ ์กฐ์ •ํ•ฉ๋‹ˆ๋‹ค.
position={[0, 3, 0]}
fontSize={0.5}
color={
playerTeamState === teamEnum.RED
? '#ff8080'
: playerTeamState === teamEnum.BLUE
? 'skyblue'
: '#454545'
}
anchorX="center"
anchorY="bottom"
>
{userInfo && userInfo.nickname}
</Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const GameField = () => {
}))
const { setSelectAnswer } = useAnswerSelectStore()
const { userInfo } = useAuth()

// ๋ฉ”์ธ ํ•„๋“œ์— ๋‹ฟ์•˜์„ ๋•Œ (์„ ํƒํ•œ ํŒ or ์„ ํƒํ•œ ๋‹ต) ์ดˆ๊ธฐํ™”
const handleEnterMainField = () => {
switch (gameState) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/(page)/(needProtection)/game/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const getPosition = (index: number, numItems = 6, radius: number) => {
return [x, y, z]
}

// ์บ๋ฆญํ„ฐ ๋ชจ๋ธ ๊ฒฝ๋กœ ๋ฆฌ์ŠคํŠธ
// ์บ๋ฆญํ„ฐ ๋ณ€๊ฒฝ ๋ชจ๋‹ฌ model Path
export const models = [
'/models/character-select/custom-model0.gltf',
'/models/character-select/custom-model1.gltf',
Expand Down
Loading

0 comments on commit 6c5c512

Please sign in to comment.