Skip to content

jigglypop/gaesup-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Gaesup World

Version Downloads

Gaesup World

Language / ์–ธ์–ด


English

Introduction

Gaesup World is a comprehensive library designed to facilitate the creation and management of interactive 3D environments on the web. Leveraging powerful tools like @react-three/fiber, @react-three/drei, and react-three-rapier, Gaesup World provides robust control mechanisms for characters, vehicles, airplanes, and more. It offers utilities such as minimaps and joysticks, making it ideal for building immersive virtual worlds and games.


Features

  • 3D Character Control: Control characters in a 3D space using React Three Fiber.
  • Simple API: Easily manage character movement and animations.
  • Extensible Structure: Customize and extend functionalities as needed.
  • Lightweight: Optimized for fast loading and performance.
  • Utilities: Includes minimaps, joysticks, and more for enhanced user experience.

Installation

Using npm

npm install @react-three/fiber @react-three/drei three @types/three @react-three/rapier ../../../src

Using yarn

yarn add @react-three/fiber @react-three/drei three @types/three @react-three/rapier ../../../src

How to Start

Here's a simple example to get you started with Gaesup World:

import React from 'react';
import { Canvas } from '@react-three/fiber';
import { Physics } from '@react-three/rapier';
import { GaesupWorld, GaesupController } from '../../../src';

export default function App() {
  const CHARACTER_URL = 'https://your-s3-bucket/gaesupyee.glb';

  return (
    <GaesupWorld
      url={{
        characterUrl: CHARACTER_URL,
      }}
      mode={{
        controller: 'keyboard', // or 'joystick', 'gamepad', etc.
      }}
    >
      <Canvas>
        <Physics>
          <GaesupController />
        </Physics>
      </Canvas>
    </GaesupWorld>
  );
}

In this example, the GaesupWorld component sets up the 3D environment, and the GaesupController manages character control. The url prop specifies the 3D model URL for the character, and the mode prop defines the type of controller to use.


Components

Gaesup World offers a variety of components to manage characters and interactive objects within the 3D environment. Below are the key components:

PlayerType

PlayerType defines various controllable player types in Gaesup World. Currently supported types include Character, Vehicle, and Airplane.

Character

The Character component handles character movement, animation, and interactions within Gaesup World.

  • Camera Types:

    • Normal: Positioned parallel to the Z-axis from the character's location and not affected by rotation.
    • Orbit: Moves with the character and rotates according to the character's direction.
  • Controller Tools:

    • Keyboard: Standard keyboard input for desktop environments.
    • Joystick: Joystick input for mobile devices.
    • GameBoy: GameBoy-style button input for mobile devices.
Usage Example
import React from 'react';
import { Canvas } from '@react-three/fiber';
import { Physics } from '@react-three/rapier';
import { GaesupWorld, GaesupController } from '../../../src';

export default function App() {
  const CHARACTER_URL = 'https://your-s3-bucket/gaesupyee.glb';

  return (
    <GaesupWorld
      url={{
        characterUrl: CHARACTER_URL,
      }}
      mode={{
        controller: 'keyboard', // or 'joystick', 'gamepad', etc.
      }}
    >
      <Canvas>
        <Physics>
          <GaesupController />
        </Physics>
      </Canvas>
    </GaesupWorld>
  );
}

Vehicle

The Vehicle component manages vehicle movement, animation, and interactions within Gaesup World. Characters can board and control vehicles.

  • Camera Types:

    • Orbit Control: Moves with the character and rotates according to the character's direction.
  • Controller Tools:

    • Keyboard: Standard keyboard input for desktop environments.
    • Joystick: Joystick input for mobile devices.
    • GameBoy: GameBoy-style button input for mobile devices.
Usage Example
import React from 'react';
import { Canvas } from '@react-three/fiber';
import { Physics } from '@react-three/rapier';
import { GaesupWorld, GaesupController, Rideable } from '../../../src';
import { V3 } from '../../../src/utils';

export default function App() {
  const CHARACTER_URL = 'https://your-s3-bucket/gaesupyee.glb';
  const VEHICLE_URL = 'https://your-s3-bucket/kart.glb';
  const WHEEL_URL = 'https://your-s3-bucket/wheel.glb';

  return (
    <GaesupWorld
      url={{
        characterUrl: CHARACTER_URL,
      }}
      mode={{
        controller: 'keyboard',
      }}
    >
      <Canvas>
        <Physics>
          <GaesupController />

          <Rideable
            objectkey="vehicle1"
            objectType="vehicle"
            isRiderOn={true}
            url={VEHICLE_URL}
            wheelUrl={WHEEL_URL}
            offset={V3(0, 0.5, 0)}
            position={V3(-10, 5, 10)}
          />
          {/* Add more Vehicle components as needed */}
        </Physics>
      </Canvas>
    </GaesupWorld>
  );
}

Airplane

The Airplane component manages airplane movement, animation, and interactions within Gaesup World. Characters can board and control airplanes.

  • Camera Types:

    • Orbit Control: Moves with the character and rotates according to the character's direction.
  • Controller Tools:

    • Keyboard: Standard keyboard input for desktop environments.
    • Joystick: Joystick input for mobile devices.
    • GameBoy: GameBoy-style button input for mobile devices.
Usage Example
import React from 'react';
import { Canvas } from '@react-three/fiber';
import { Physics } from '@react-three/rapier';
import { GaesupWorld, GaesupController, Rideable } from '../../../src';
import { V3 } from '../../../src/utils';

export default function App() {
  const CHARACTER_URL = 'https://your-s3-bucket/gaesupyee.glb';
  const AIRPLANE_URL = 'https://your-s3-bucket/air.glb';

  return (
    <GaesupWorld
      url={{
        characterUrl: CHARACTER_URL,
      }}
      mode={{
        controller: 'keyboard',
      }}
    >
      <Canvas>
        <Physics>
          <GaesupController />

          <Rideable
            objectkey="airplane1"
            objectType="airplane"
            isRiderOn={true}
            url={AIRPLANE_URL}
            offset={V3(0, 0.5, 0)}
            position={V3(10, 5, 10)}
          />
          {/* Add more Airplane components as needed */}
        </Physics>
      </Canvas>
    </GaesupWorld>
  );
}

Animation

The Animation component manages animations for characters and other elements within Gaesup World. It allows defining various animation states and triggering animations based on conditions.

  • Key Features:
    • Animation State Management: Manage multiple animation states and trigger animations based on specific conditions.
    • Conditional Animations: Automatically switch animations when certain conditions are met.
    • Extensible Animation System: Easily add custom animations as needed.

Rideable

The Rideable component defines objects that characters can ride, such as vehicles and airplanes. It detects collisions and allows characters to board when contact is made.

  • Key Features:
    • Support for Various Rideable Objects: Currently supports "vehicle" and "airplane" types.
    • Customizable Properties: Easily configure initial state, size, model URLs, visibility, and more.
    • Interaction with Riders: Manages interactions required for a rider to board and move with rideable objects.
Usage Example
import React from 'react';
import { Canvas } from '@react-three/fiber';
import { Physics } from '@react-three/rapier';
import { GaesupWorld, GaesupController, Rideable } from '../../../src';
import { V3 } from '../../../src/utils';

export default function App() {
  const CHARACTER_URL = 'https://your-s3-bucket/gaesupyee.glb';
  const VEHICLE_URL = 'https://your-s3-bucket/kart.glb';
  const WHEEL_URL = 'https://your-s3-bucket/wheel.glb';
  const AIRPLANE_URL = 'https://your-s3-bucket/air.glb';

  return (
    <GaesupWorld
      url={{
        characterUrl: CHARACTER_URL,
      }}
      mode={{
        controller: 'keyboard',
      }}
    >
      <Canvas>
        <Physics>
          <GaesupController />

          <Rideable
            objectkey="vehicle1"
            objectType="vehicle"
            isRiderOn={true}
            url={VEHICLE_URL}
            wheelUrl={WHEEL_URL}
            offset={V3(0, 0.5, 0)}
            position={V3(-10, 5, 10)}
          />
          <Rideable
            objectkey="vehicle2"
            objectType="vehicle"
            isRiderOn={false}
            url={VEHICLE_URL}
            wheelUrl={WHEEL_URL}
            position={V3(-20, 5, 10)}
          />
          <Rideable
            objectkey="airplane1"
            objectType="airplane"
            isRiderOn={true}
            url={AIRPLANE_URL}
            offset={V3(0, 0.5, 0)}
            position={V3(10, 5, 10)}
          />
          <Rideable
            objectkey="airplane2"
            objectType="airplane"
            isRiderOn={false}
            url={AIRPLANE_URL}
            position={V3(20, 5, 10)}
          />
        </Physics>
      </Canvas>
    </GaesupWorld>
  );
}

Important Notes:

  • The objectkey must be unique for each Rideable component.
  • objectType should be either "vehicle" or "airplane".
Props Description
Prop Name Type Required Description Default Value
objectkey string Required Unique identifier for the rideable object None
objectType "vehicle" or "airplane" Optional Type of the rideable object undefined
isRiderOn boolean Optional Whether a rider is on the rideable object false
url string Optional 3D model URL for the rideable object null
wheelUrl string Optional Wheel model URL for "vehicle" type rideables null
position THREE.Vector3 Optional Initial position of the rideable object (0, 0, 0)
rotation THREE.Euler Optional Initial rotation angle of the rideable object (0, 0, 0)
offset THREE.Vector3 Optional Initial position offset for the rideable object (0, 0, 0)
visible boolean Optional Visibility of the rideable object true
vehicleSize THREE.Vector3 Optional Size of the "vehicle" type rideable object Rapier default
wheelSize THREE.Vector3 Optional Size of the wheel for "vehicle" type rideables Rapier default
airplaneSize THREE.Vector3 Optional Size of the "airplane" type rideable object Rapier default

Passive

The Passive component defines objects that do not require interaction, such as buildings or other static objects within the environment.

  • Key Features:
    • Static Object Management: Efficiently manages static environment objects.
    • Performance Optimization: Optimizes rendering of static objects to enhance overall performance.
    • Customizable Appearance: Easily configure the appearance and position of static objects.

Tools

Gaesup World includes various utility components to enhance user interaction and experience within the 3D environment.

Joystick

  • Description: Provides a virtual joystick interface primarily intended for mobile environments. Prevents position jitter on mobile devices using the scrollBlock option in the GaesupWorld component.

  • Props:

    Prop Name Type Required Description Default Value
    joystickStyle object (styles) Optional Style for the joystick undefined
    joystickBallStyle object (styles) Optional Style for the joystick ball undefined
  • Usage Example:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, Joystick } from '../../../src';
    
    export default function App() {
      const joystickStyle = {
        /* Define joystick container styles */
      };
      const joystickBallStyle = {
        /* Define joystick ball styles */
      };
    
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'joystick', // or 'keyboard', 'gamepad', etc.
            scrollBlock: true, // Prevent position jitter
          }}
        >
          <Canvas>
            <Physics>
              <Joystick
                joystickStyle={joystickStyle}
                joystickBallStyle={joystickBallStyle}
              />
              {/* Other components */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • Key Features:

    • Joystick Interface: Simulates joystick input for mobile devices.
    • Customization: Customize the appearance using joystickStyle and joystickBallStyle.
    • Responsive Interaction: Responds to both mouse and touch events for controlling movement.

KeyBoardTooltip

  • Description: Visually represents a keyboard controller interface, displaying each key and its associated action.

  • Key Features:

    • Visualizing Keyboard Keys: Displays all keyboard keys in an array format.
    • State Animation: Highlights active keys to provide user feedback.
    • Custom Styling: Customize keycaps' appearance using various style properties.
  • Usage Example:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, KeyBoardToolTip } from '../../../src';
    
    export default function App() {
      const keyBoardToolTipInnerStyle = {
        /* Define inner tooltip styles */
      };
      const selectedKeyCapStyle = {
        /* Define styles for selected keycaps */
      };
      const notSelectedkeyCapStyle = {
        /* Define styles for non-selected keycaps */
      };
      const keyCapStyle = {
        /* Define default keycap styles */
      };
    
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'keyboard', // Ensure controller mode is set to 'keyboard'
          }}
        >
          <Canvas>
            <Physics>
              <KeyBoardToolTip
                keyBoardToolTipInnerStyle={keyBoardToolTipInnerStyle}
                selectedKeyCapStyle={selectedKeyCapStyle}
                notSelectedkeyCapStyle={notSelectedkeyCapStyle}
                keyCapStyle={keyCapStyle}
              />
              {/* Other components */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }

MiniMap

  • Description: Displays a small map indicating the user's location and the surrounding environment within the 3D world.

  • Props:

    Prop Name Type Required Description Default Value
    minimapStyle object (styles) Optional Style for the MiniMap container undefined
    innerStyle object (styles) Optional Style for the inner MiniMap container undefined
    textStyle object (styles) Optional Style for text within the MiniMap undefined
    objectStyle object (styles) Optional Style for objects within the MiniMap undefined
    avatarStyle object (styles) Optional Style for avatars within the MiniMap undefined
    scaleStyle object (styles) Optional Style for the scale control of the MiniMap undefined
    directionStyle object (styles) Optional Style for direction indicators in the MiniMap undefined
    plusMinusStyle object (styles) Optional Style for plus/minus controls in the MiniMap undefined
  • Usage Example:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, MiniMap } from '../../../src';
    
    export default function App() {
      const minimapStyle = {
        /* Define MiniMap container styles */
      };
      const innerStyle = {
        /* Define inner MiniMap styles */
      };
      // Define other style properties as needed
    
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'keyboard',
          }}
        >
          <Canvas>
            <Physics>
              <MiniMap
                minimapStyle={minimapStyle}
                innerStyle={innerStyle}
                // Pass other style properties as needed
              />
              {/* Other components */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • Key Features:

    • Dynamic Scaling: Users can adjust the size of the MiniMap.
    • Direction Indicators: Displays directions like East, West, South, and North.
    • Custom Styling: Customize the appearance of the MiniMap and its elements.
    • Mouse Wheel Support: Adjust the MiniMap's scale using the mouse wheel.

GameBoy

  • Description: Emulates GameBoy-style directional buttons for mobile environments, providing an intuitive control interface.

  • Props:

    Prop Name Type Required Description Default Value
    gamePadStyle object (styles) Optional Style for the GamePad container undefined
    gamePadButtonStyle object (styles) Optional Style for individual GamePad buttons undefined
    label string Optional Custom label for the buttons undefined
  • Usage Example:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, GameBoy } from '../../../src';
    
    export default function App() {
      const gamePadStyle = {
        /* Define GamePad container styles */
      };
      const gamePadButtonStyle = {
        /* Define GamePad button styles */
      };
    
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'gameboy', // Ensure controller mode is set to 'gameboy'
          }}
        >
          <Canvas>
            <Physics>
              <GameBoy
                gamePadStyle={gamePadStyle}
                gamePadButtonStyle={gamePadButtonStyle}
              />
              {/* Other components */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • Key Features:

    • Direction Buttons: Implements buttons for directional input (forward, backward, left, right).
    • Context-aware Rendering: Renders based on the mode.controller value from the GaesupWorldContext.
    • Custom Styling: Allows customization of the GamePad's appearance using gamePadStyle and gamePadButtonStyle.

GamePad

  • Description: Provides a customizable controller interface supporting various controller modes, such as joysticks and GameBoys, offering versatility for different input scenarios.

  • Props:

    Prop Name Type Required Description Default Value
    gamePadStyle object (styles) Optional Style for the GamePad container undefined
    gamePadButtonStyle object (styles) Optional Style for individual GamePad buttons undefined
    label string Optional Custom label for the buttons undefined
  • Usage Example:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, GamePad } from '../../../src';
    
    export default function App() {
      const gamePadStyle = {
        /* Define GamePad container styles */
      };
      const gamePadButtonStyle = {
        /* Define GamePad button styles */
      };
    
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'gamepad', // or 'joystick', 'gameboy', etc.
          }}
        >
          <Canvas>
            <Physics>
              <GamePad
                gamePadStyle={gamePadStyle}
                gamePadButtonStyle={gamePadButtonStyle}
              />
              {/* Other components */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • Key Features:

    • Dynamic Button Rendering: Generates buttons based on the control object from GaesupWorldContext.
    • Universal Usage: Compatible with various controller modes like joysticks and GameBoys.
    • Custom Styling: Customize the appearance using gamePadStyle and gamePadButtonStyle.

ZoomButton

  • Description: Moves the camera to a specific location and controls the camera's zoom, primarily used for zooming to a target.

  • Props:

    Prop Name Type Required Description Default Value
    position THREE.Vector3 Required Target position for the camera to move to None
    children React.ReactNode Optional React nodes to render within the button undefined
    target THREE.Vector3 Optional Target position for the camera to look at undefined
    keepBlocking boolean Optional Determines whether to keep blocking while camera is moving undefined
    zoomButtonStyle object (styles) Optional Style for the ZoomButton component undefined
  • Usage Example:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, ZoomButton } from '../../../src';
    import * as THREE from 'three';
    
    export default function App() {
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'keyboard',
          }}
        >
          <Canvas>
            <Physics>
              <ZoomButton
                position={new THREE.Vector3(0, 0, 5)}
                target={new THREE.Vector3(0, 0, 0)}
                zoomButtonStyle={{ backgroundColor: 'blue', color: 'white' }}
              >
                Zoom In
              </ZoomButton>
              {/* Other components */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • Key Features:

    • Camera Movement: Moves the camera to the specified position upon button click.
    • Zoom Control: Adjusts the camera's zoom level.
    • Custom Styling: Customize the button's appearance using zoomButtonStyle.

teleport

  • Description: Represents a clickable portal that allows users to teleport to a specified location within the 3D world. Ideal for creating interactive teleportation points in your application.

  • Props:

    Prop Name Type Required Description Default Value
    text string Optional The text to display on the portal. undefined
    position THREE.Vector3 Required The target position to teleport to using a THREE.Vector3. None
    teleportStyle CSSProperties Optional CSS styles for customizing the appearance of the portal. undefined
  • Usage Example:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, teleport } from '../../../src';
    import * as THREE from 'three';
    
    export default function App() {
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'keyboard',
          }}
        >
          <Canvas>
            <Physics>
              <teleport
                text="Teleport"
                position={new THREE.Vector3(10, 0, 5)}
                teleportStyle={{ backgroundColor: "blue", color: "white" }}
              />
              {/* Other components */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • Key Features:

    • Teleport Functionality: Moves the camera and character to the specified position upon clicking the portal.
    • Custom Styling: Customize the portal's appearance using teleportStyle.
    • Text Display: Displays text on the portal to guide users.

How to Contribute

If you would like to contribute to Gaesup World, please follow these steps:

  1. Fork the Project: Click the "Fork" button on GitHub to create your own copy of the repository.

  2. Switch to the Development Branch: Navigate to the dev branch.

    git checkout dev
  3. Commit Your Changes: Make your changes and commit them with a descriptive message.

    git commit -m 'Add some AmazingFeature'
  4. Push to the Branch: Push your changes to your forked repository.

    git push origin dev
  5. Create a Pull Request: Go to your forked repository on GitHub and create a Pull Request to the original repository's dev branch.


License

This project is distributed under the MIT License. For more details, please refer to the LICENSE file.


Additional Information

Gaesup World is continuously updated and improved based on user feedback. For more information or assistance, feel free to reach out via the GitHub Issues page.


Build immersive web 3D environments with Gaesup World!

ํ•œ๊ตญ์–ด

์†Œ๊ฐœ

Gaesup World๋Š” ์›น์—์„œ ์ƒํ˜ธ์ž‘์šฉ ๊ฐ€๋Šฅํ•œ 3D ํ™˜๊ฒฝ์„ ์†์‰ฝ๊ฒŒ ์ƒ์„ฑํ•˜๊ณ  ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋„๋ก ์„ค๊ณ„๋œ ์ข…ํ•ฉ์ ์ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค. @react-three/fiber, @react-three/drei, react-three-rapier์™€ ๊ฐ™์€ ๊ฐ•๋ ฅํ•œ ๋„๊ตฌ๋ฅผ ํ™œ์šฉํ•˜์—ฌ ์บ๋ฆญํ„ฐ, ๋น„ํ–‰๊ธฐ, ์ฐจ๋Ÿ‰ ๋“ฑ ๋‹ค์–‘ํ•œ ๊ฐ์ฒด์˜ ์ œ์–ด ๋ฉ”์ปค๋‹ˆ์ฆ˜์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๋ฏธ๋‹ˆ๋งต, ์กฐ์ด์Šคํ‹ฑ๊ณผ ๊ฐ™์€ ์œ ํ‹ธ๋ฆฌํ‹ฐ๋ฅผ ํ†ตํ•ด ๋ชฐ์ž…๊ฐ ์žˆ๋Š” ๊ฐ€์ƒ ์„ธ๊ณ„์™€ ๊ฒŒ์ž„์„ ๊ตฌ์ถ•ํ•˜๋Š” ๋ฐ ์ด์ƒ์ ์ž…๋‹ˆ๋‹ค.


ํŠน์ง•

  • 3D ์บ๋ฆญํ„ฐ ์ปจํŠธ๋กค: React Three Fiber๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ 3D ๊ณต๊ฐ„์—์„œ ์บ๋ฆญํ„ฐ๋ฅผ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.
  • ๊ฐ„ํŽธํ•œ API: ์บ๋ฆญํ„ฐ์˜ ์ด๋™๊ณผ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์‰ฝ๊ฒŒ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ„๋‹จํ•œ API ์ œ๊ณต.
  • ํ™•์žฅ ๊ฐ€๋Šฅํ•œ ๊ตฌ์กฐ: ํ•„์š”์— ๋”ฐ๋ผ ๊ธฐ๋Šฅ์„ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•˜๊ณ  ํ™•์žฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ๊ฒฝ๋Ÿ‰ํ™”: ๋น ๋ฅธ ๋กœ๋”ฉ๊ณผ ์„ฑ๋Šฅ ์ตœ์ ํ™”๋ฅผ ์œ„ํ•ด ๊ฒฝ๋Ÿ‰ํ™” ์„ค๊ณ„.
  • ์œ ํ‹ธ๋ฆฌํ‹ฐ: ๋ฏธ๋‹ˆ๋งต, ์กฐ์ด์Šคํ‹ฑ ๋“ฑ ์‚ฌ์šฉ์ž ๊ฒฝํ—˜์„ ํ–ฅ์ƒ์‹œํ‚ค๋Š” ๋‹ค์–‘ํ•œ ์œ ํ‹ธ๋ฆฌํ‹ฐ ํฌํ•จ.

์„ค์น˜ ๋ฐฉ๋ฒ•

npm์„ ์ด์šฉํ•œ ์„ค์น˜

npm install @react-three/fiber @react-three/drei three @types/three @react-three/rapier ../../../src

yarn์„ ์ด์šฉํ•œ ์„ค์น˜

yarn add @react-three/fiber @react-three/drei three @types/three @react-three/rapier ../../../src

์‹œ์ž‘ํ•˜๊ธฐ

๋‹ค์Œ์€ Gaesup World์˜ ๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•์„ ์†Œ๊ฐœํ•˜๋Š” ๊ฐ„๋‹จํ•œ ์˜ˆ์ œ์ž…๋‹ˆ๋‹ค:

import React from 'react';
import { Canvas } from '@react-three/fiber';
import { Physics } from '@react-three/rapier';
import { GaesupWorld, GaesupController } from '../../../src';

export default function App() {
  const CHARACTER_URL = 'https://your-s3-bucket/gaesupyee.glb';

  return (
    <GaesupWorld
      url={{
        characterUrl: CHARACTER_URL,
      }}
      mode={{
        controller: 'keyboard', // ๋˜๋Š” 'joystick', 'gamepad' ๋“ฑ
      }}
    >
      <Canvas>
        <Physics>
          <GaesupController />
        </Physics>
      </Canvas>
    </GaesupWorld>
  );
}

์œ„ ์˜ˆ์ œ์—์„œ๋Š” GaesupWorld ์ปดํฌ๋„ŒํŠธ๋ฅผ ํ†ตํ•ด 3D ํ™˜๊ฒฝ์„ ์„ค์ •ํ•˜๊ณ , GaesupController๋ฅผ ์ด์šฉํ•˜์—ฌ ์บ๋ฆญํ„ฐ๋ฅผ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค. url prop์„ ํ†ตํ•ด ์บ๋ฆญํ„ฐ์˜ 3D ๋ชจ๋ธ URL์„ ์ง€์ •ํ•˜๊ณ , mode prop์„ ํ†ตํ•ด ์‚ฌ์šฉํ•˜๊ณ ์ž ํ•˜๋Š” ์ปจํŠธ๋กค๋Ÿฌ ํƒ€์ž…์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.


์ปดํฌ๋„ŒํŠธ

Gaesup World๋Š” ๋‹ค์–‘ํ•œ ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ œ๊ณตํ•˜์—ฌ ์บ๋ฆญํ„ฐ์™€ ๊ฐ์ฒด์˜ ์ œ์–ด, ์ƒํ˜ธ์ž‘์šฉ์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. ์ฃผ์š” ์ปดํฌ๋„ŒํŠธ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

PlayerType

PlayerType์€ Gaesup World์—์„œ ์ œ์–ดํ•  ์ˆ˜ ์žˆ๋Š” ๋‹ค์–‘ํ•œ ํ”Œ๋ ˆ์ด์–ด ํƒ€์ž…์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ ์ง€์›๋˜๋Š” ํƒ€์ž…์€ Character, Vehicle, Airplane์ž…๋‹ˆ๋‹ค.

Character

Character ์ปดํฌ๋„ŒํŠธ๋Š” Gaesup World ๋‚ด์—์„œ ์บ๋ฆญํ„ฐ์˜ ์ด๋™, ์• ๋‹ˆ๋ฉ”์ด์…˜, ์ƒํ˜ธ์ž‘์šฉ์„ ๊ด€๋ฆฌํ•˜๋Š” ํ•ต์‹ฌ ์ปดํฌ๋„ŒํŠธ์ž…๋‹ˆ๋‹ค.

  • ์นด๋ฉ”๋ผ ํƒ€์ž…:

    • Normal: ์บ๋ฆญํ„ฐ์˜ ์œ„์น˜๋ฅผ ๊ธฐ์ค€์œผ๋กœ Z์ถ•์— ํ‰ํ–‰ํ•˜๊ฒŒ ๋ฐฐ์น˜๋˜๋ฉฐ, ์บ๋ฆญํ„ฐ์˜ ํšŒ์ „์— ์˜ํ–ฅ์„ ๋ฐ›์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
    • Orbit: ์บ๋ฆญํ„ฐ์™€ ํ•จ๊ป˜ ์›€์ง์ด๋ฉฐ ์บ๋ฆญํ„ฐ์˜ ๋ฐฉํ–ฅ์— ๋”ฐ๋ผ ์นด๋ฉ”๋ผ๊ฐ€ ํšŒ์ „ํ•ฉ๋‹ˆ๋‹ค.
  • ์ปจํŠธ๋กค๋Ÿฌ ๋„๊ตฌ:

    • Keyboard: ๋ฐ์Šคํฌํƒ‘ ํ™˜๊ฒฝ์—์„œ ํ‘œ์ค€ ํ‚ค๋ณด๋“œ ์ž…๋ ฅ์„ ํ†ตํ•ด ์บ๋ฆญํ„ฐ๋ฅผ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.
    • Joystick: ๋ชจ๋ฐ”์ผ ํ™˜๊ฒฝ์—์„œ ์กฐ์ด์Šคํ‹ฑ ์ž…๋ ฅ์„ ํ†ตํ•ด ์บ๋ฆญํ„ฐ๋ฅผ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.
    • GameBoy: ๋ชจ๋ฐ”์ผ ํ™˜๊ฒฝ์—์„œ GameBoy ์Šคํƒ€์ผ์˜ ๋ฒ„ํŠผ ์ž…๋ ฅ์„ ํ†ตํ•ด ์บ๋ฆญํ„ฐ๋ฅผ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.
์‚ฌ์šฉ ์˜ˆ์ œ
import React from 'react';
import { Canvas } from '@react-three/fiber';
import { Physics } from '@react-three/rapier';
import { GaesupWorld, GaesupController } from '../../../src';

export default function App() {
  const CHARACTER_URL = 'https://your-s3-bucket/gaesupyee.glb';

  return (
    <GaesupWorld
      url={{
        characterUrl: CHARACTER_URL,
      }}
      mode={{
        controller: 'keyboard', // ๋˜๋Š” 'joystick', 'gamepad' ๋“ฑ
      }}
    >
      <Canvas>
        <Physics>
          <GaesupController />
        </Physics>
      </Canvas>
    </GaesupWorld>
  );
}

Vehicle

Vehicle ์ปดํฌ๋„ŒํŠธ๋Š” Gaesup World ๋‚ด์—์„œ ์ฐจ๋Ÿ‰์˜ ์ด๋™, ์• ๋‹ˆ๋ฉ”์ด์…˜, ์ƒํ˜ธ์ž‘์šฉ์„ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ์บ๋ฆญํ„ฐ๊ฐ€ ์ฐจ๋Ÿ‰์— ํƒ‘์Šนํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ์นด๋ฉ”๋ผ ํƒ€์ž…:

    • Orbit Control: ์บ๋ฆญํ„ฐ์™€ ํ•จ๊ป˜ ์›€์ง์ด๋ฉฐ ์บ๋ฆญํ„ฐ์˜ ๋ฐฉํ–ฅ์— ๋”ฐ๋ผ ์นด๋ฉ”๋ผ๊ฐ€ ํšŒ์ „ํ•ฉ๋‹ˆ๋‹ค.
  • ์ปจํŠธ๋กค๋Ÿฌ ๋„๊ตฌ:

    • Keyboard: ๋ฐ์Šคํฌํƒ‘ ํ™˜๊ฒฝ์—์„œ ํ‘œ์ค€ ํ‚ค๋ณด๋“œ ์ž…๋ ฅ์„ ํ†ตํ•ด ์ฐจ๋Ÿ‰์„ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.
    • Joystick: ๋ชจ๋ฐ”์ผ ํ™˜๊ฒฝ์—์„œ ์กฐ์ด์Šคํ‹ฑ ์ž…๋ ฅ์„ ํ†ตํ•ด ์ฐจ๋Ÿ‰์„ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.
    • GameBoy: ๋ชจ๋ฐ”์ผ ํ™˜๊ฒฝ์—์„œ GameBoy ์Šคํƒ€์ผ์˜ ๋ฒ„ํŠผ ์ž…๋ ฅ์„ ํ†ตํ•ด ์ฐจ๋Ÿ‰์„ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.
์‚ฌ์šฉ ์˜ˆ์ œ
import React from 'react';
import { Canvas } from '@react-three/fiber';
import { Physics } from '@react-three/rapier';
import { GaesupWorld, GaesupController, Rideable } from '../../../src';
import { V3 } from '../../../src/utils';

export default function App() {
  const CHARACTER_URL = 'https://your-s3-bucket/gaesupyee.glb';
  const VEHICLE_URL = 'https://your-s3-bucket/kart.glb';
  const WHEEL_URL = 'https://your-s3-bucket/wheel.glb';

  return (
    <GaesupWorld
      url={{
        characterUrl: CHARACTER_URL,
      }}
      mode={{
        controller: 'keyboard',
      }}
    >
      <Canvas>
        <Physics>
          <GaesupController />

          <Rideable
            objectkey="vehicle1"
            objectType="vehicle"
            isRiderOn={true}
            url={VEHICLE_URL}
            wheelUrl={WHEEL_URL}
            offset={V3(0, 0.5, 0)}
            position={V3(-10, 5, 10)}
          />
          {/* ์ถ”๊ฐ€์ ์ธ Vehicle ์ปดํฌ๋„ŒํŠธ */}
        </Physics>
      </Canvas>
    </GaesupWorld>
  );
}

Airplane

Airplane ์ปดํฌ๋„ŒํŠธ๋Š” Gaesup World ๋‚ด์—์„œ ๋น„ํ–‰๊ธฐ์˜ ์ด๋™, ์• ๋‹ˆ๋ฉ”์ด์…˜, ์ƒํ˜ธ์ž‘์šฉ์„ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ์บ๋ฆญํ„ฐ๊ฐ€ ๋น„ํ–‰๊ธฐ์— ํƒ‘์Šนํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ์นด๋ฉ”๋ผ ํƒ€์ž…:

    • Orbit Control: ์บ๋ฆญํ„ฐ์™€ ํ•จ๊ป˜ ์›€์ง์ด๋ฉฐ ์บ๋ฆญํ„ฐ์˜ ๋ฐฉํ–ฅ์— ๋”ฐ๋ผ ์นด๋ฉ”๋ผ๊ฐ€ ํšŒ์ „ํ•ฉ๋‹ˆ๋‹ค.
  • ์ปจํŠธ๋กค๋Ÿฌ ๋„๊ตฌ:

    • Keyboard: ๋ฐ์Šคํฌํƒ‘ ํ™˜๊ฒฝ์—์„œ ํ‘œ์ค€ ํ‚ค๋ณด๋“œ ์ž…๋ ฅ์„ ํ†ตํ•ด ๋น„ํ–‰๊ธฐ๋ฅผ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.
    • Joystick: ๋ชจ๋ฐ”์ผ ํ™˜๊ฒฝ์—์„œ ์กฐ์ด์Šคํ‹ฑ ์ž…๋ ฅ์„ ํ†ตํ•ด ๋น„ํ–‰๊ธฐ๋ฅผ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.
    • GameBoy: ๋ชจ๋ฐ”์ผ ํ™˜๊ฒฝ์—์„œ GameBoy ์Šคํƒ€์ผ์˜ ๋ฒ„ํŠผ ์ž…๋ ฅ์„ ํ†ตํ•ด ๋น„ํ–‰๊ธฐ๋ฅผ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.
์‚ฌ์šฉ ์˜ˆ์ œ
import React from 'react';
import { Canvas } from '@react-three/fiber';
import { Physics } from '@react-three/rapier';
import { GaesupWorld, GaesupController, Rideable } from '../../../src';
import { V3 } from '../../../src/utils';

export default function App() {
  const CHARACTER_URL = 'https://your-s3-bucket/gaesupyee.glb';
  const AIRPLANE_URL = 'https://your-s3-bucket/air.glb';

  return (
    <GaesupWorld
      url={{
        characterUrl: CHARACTER_URL,
      }}
      mode={{
        controller: 'keyboard',
      }}
    >
      <Canvas>
        <Physics>
          <GaesupController />

          <Rideable
            objectkey="airplane1"
            objectType="airplane"
            isRiderOn={true}
            url={AIRPLANE_URL}
            offset={V3(0, 0.5, 0)}
            position={V3(10, 5, 10)}
          />
          {/* ์ถ”๊ฐ€์ ์ธ Airplane ์ปดํฌ๋„ŒํŠธ */}
        </Physics>
      </Canvas>
    </GaesupWorld>
  );
}

Animation

Animation ์ปดํฌ๋„ŒํŠธ๋Š” ์บ๋ฆญํ„ฐ์™€ ๊ธฐํƒ€ ๊ฐ์ฒด์˜ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ๊ด€๋ฆฌํ•˜๋Š” ๋ฉ”์„œ๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์–‘ํ•œ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์ƒํƒœ๋ฅผ ์ •์˜ํ•˜๊ณ , ์กฐ๊ฑด์— ๋”ฐ๋ผ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ํŠธ๋ฆฌ๊ฑฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ์ฃผ์š” ๊ธฐ๋Šฅ:
    • ์• ๋‹ˆ๋ฉ”์ด์…˜ ์ƒํƒœ ๊ด€๋ฆฌ: ์—ฌ๋Ÿฌ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•˜๊ณ , ํ˜„์žฌ ์ƒํƒœ๋ฅผ ํŠธ๋ฆฌ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.
    • ์กฐ๊ฑด๋ถ€ ์• ๋‹ˆ๋ฉ”์ด์…˜: ํŠน์ • ์กฐ๊ฑด์— ๋”ฐ๋ผ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์ž๋™์œผ๋กœ ์ „ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
    • ํ™•์žฅ ๊ฐ€๋Šฅํ•œ ์• ๋‹ˆ๋ฉ”์ด์…˜ ์‹œ์Šคํ…œ: ์‚ฌ์šฉ์ž ์ •์˜ ์• ๋‹ˆ๋ฉ”์ด์…˜์„ ์‰ฝ๊ฒŒ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Rideable

Rideable ์ปดํฌ๋„ŒํŠธ๋Š” ์บ๋ฆญํ„ฐ๊ฐ€ ํƒ‘์Šนํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ์ฒด๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ์ด ์ปดํฌ๋„ŒํŠธ๋Š” ์ถฉ๋Œ์„ ๊ฐ์ง€ํ•˜์—ฌ ์บ๋ฆญํ„ฐ๊ฐ€ ๊ฐ์ฒด์— ํƒ‘์Šนํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

  • ์ฃผ์š” ๊ธฐ๋Šฅ:
    • ํƒ‘์Šน ๊ฐ€๋Šฅ ๊ฐ์ฒด ์ง€์›: ํ˜„์žฌ "vehicle"๊ณผ "airplane" ํƒ€์ž…์˜ ๊ฐ์ฒด๋ฅผ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.
    • ์ปค์Šคํ„ฐ๋งˆ์ด์ง• ๊ฐ€๋Šฅํ•œ ์†์„ฑ: ๊ฐ์ฒด์˜ ์œ„์น˜, ํšŒ์ „, ๋ชจ๋ธ URL ๋“ฑ์„ ์‰ฝ๊ฒŒ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • ์ƒํ˜ธ์ž‘์šฉ ๊ด€๋ฆฌ: ์บ๋ฆญํ„ฐ์™€ ๊ฐ์ฒด ๊ฐ„์˜ ์ƒํ˜ธ์ž‘์šฉ์„ ๊ด€๋ฆฌํ•˜์—ฌ ์ž์—ฐ์Šค๋Ÿฌ์šด ํƒ‘์Šน ๊ฒฝํ—˜์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
์‚ฌ์šฉ ์˜ˆ์ œ
import React from 'react';
import { Canvas } from '@react-three/fiber';
import { Physics } from '@react-three/rapier';
import { GaesupWorld, GaesupController, Rideable } from '../../../src';
import { V3 } from '../../../src/utils';

export default function App() {
  const CHARACTER_URL = 'https://your-s3-bucket/gaesupyee.glb';
  const VEHICLE_URL = 'https://your-s3-bucket/kart.glb';
  const WHEEL_URL = 'https://your-s3-bucket/wheel.glb';
  const AIRPLANE_URL = 'https://your-s3-bucket/air.glb';

  return (
    <GaesupWorld
      url={{
        characterUrl: CHARACTER_URL,
      }}
      mode={{
        controller: 'keyboard',
      }}
    >
      <Canvas>
        <Physics>
          <GaesupController />

          <Rideable
            objectkey="vehicle1"
            objectType="vehicle"
            isRiderOn={true}
            url={VEHICLE_URL}
            wheelUrl={WHEEL_URL}
            offset={V3(0, 0.5, 0)}
            position={V3(-10, 5, 10)}
          />
          <Rideable
            objectkey="vehicle2"
            objectType="vehicle"
            isRiderOn={false}
            url={VEHICLE_URL}
            wheelUrl={WHEEL_URL}
            position={V3(-20, 5, 10)}
          />
          <Rideable
            objectkey="airplane1"
            objectType="airplane"
            isRiderOn={true}
            url={AIRPLANE_URL}
            offset={V3(0, 0.5, 0)}
            position={V3(10, 5, 10)}
          />
          <Rideable
            objectkey="airplane2"
            objectType="airplane"
            isRiderOn={false}
            url={AIRPLANE_URL}
            position={V3(20, 5, 10)}
          />
        </Physics>
      </Canvas>
    </GaesupWorld>
  );
}

์ค‘์š” ์‚ฌํ•ญ:

  • objectkey๋Š” ๊ฐ Rideable ์ปดํฌ๋„ŒํŠธ๋งˆ๋‹ค ๊ณ ์œ ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
  • objectType์€ "vehicle" ๋˜๋Š” "airplane"์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
Props ์„ค๋ช…
Prop Name Type Required Description Default Value
objectkey string Required ํƒ‘์Šน ๊ฐ€๋Šฅํ•œ ๊ฐ์ฒด์˜ ๊ณ ์œ  ์‹๋ณ„์ž None
objectType "vehicle" or "airplane" Optional ํƒ‘์Šน ๊ฐ€๋Šฅํ•œ ๊ฐ์ฒด์˜ ํƒ€์ž… undefined
isRiderOn boolean Optional ๊ฐ์ฒด์— ํƒ‘์Šน ์ค‘์ธ์ง€ ์—ฌ๋ถ€ false
url string Optional ํƒ‘์Šน ๊ฐ€๋Šฅํ•œ ๊ฐ์ฒด์˜ 3D ๋ชจ๋ธ URL null
wheelUrl string Optional "vehicle" ํƒ€์ž… ๊ฐ์ฒด์˜ ํœ  ๋ชจ๋ธ URL null
position THREE.Vector3 Optional ๊ฐ์ฒด์˜ ์ดˆ๊ธฐ ์œ„์น˜ (0, 0, 0)
rotation THREE.Euler Optional ๊ฐ์ฒด์˜ ์ดˆ๊ธฐ ํšŒ์ „ ๊ฐ๋„ (0, 0, 0)
offset THREE.Vector3 Optional ๊ฐ์ฒด์˜ ์œ„์น˜ ์˜คํ”„์…‹ (0, 0, 0)
visible boolean Optional ๊ฐ์ฒด์˜ ๊ฐ€์‹œ์„ฑ true
vehicleSize THREE.Vector3 Optional "vehicle" ํƒ€์ž… ๊ฐ์ฒด์˜ ํฌ๊ธฐ Rapier ๊ธฐ๋ณธ๊ฐ’
wheelSize THREE.Vector3 Optional "vehicle" ํƒ€์ž… ํœ ์˜ ํฌ๊ธฐ Rapier ๊ธฐ๋ณธ๊ฐ’
airplaneSize THREE.Vector3 Optional "airplane" ํƒ€์ž… ๊ฐ์ฒด์˜ ํฌ๊ธฐ Rapier ๊ธฐ๋ณธ๊ฐ’

Passive

Passive ์ปดํฌ๋„ŒํŠธ๋Š” ์ƒํ˜ธ์ž‘์šฉ์ด ํ•„์š” ์—†๋Š” ๊ฐ์ฒด๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์ฃผ๋ณ€ ํ™˜๊ฒฝ์„ ๊ตฌ์„ฑํ•˜๋Š” ๊ฑด๋ฌผ์ด๋‚˜ ๊ธฐํƒ€ ์ •์  ๊ฐ์ฒด ๋“ฑ์„ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

  • ์ฃผ์š” ๊ธฐ๋Šฅ:
    • ์ •์  ๊ฐ์ฒด ๊ด€๋ฆฌ: ์ƒํ˜ธ์ž‘์šฉ์ด ํ•„์š” ์—†๋Š” ํ™˜๊ฒฝ ๊ฐ์ฒด๋ฅผ ํšจ์œจ์ ์œผ๋กœ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค.
    • ์„ฑ๋Šฅ ์ตœ์ ํ™”: ์ •์  ๊ฐ์ฒด์˜ ๋ Œ๋”๋ง์„ ์ตœ์ ํ™”ํ•˜์—ฌ ์ „์ฒด์ ์ธ ์„ฑ๋Šฅ์„ ํ–ฅ์ƒ์‹œํ‚ต๋‹ˆ๋‹ค.
    • ์ปค์Šคํ„ฐ๋งˆ์ด์ง•: ๋‹ค์–‘ํ•œ ์ •์  ๊ฐ์ฒด์˜ ์™ธ๊ด€๊ณผ ์œ„์น˜๋ฅผ ์‰ฝ๊ฒŒ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Tools

Gaesup World๋Š” ๋‹ค์–‘ํ•œ ๋„๊ตฌ ์ปดํฌ๋„ŒํŠธ๋ฅผ ์ œ๊ณตํ•˜์—ฌ ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ํ–ฅ์ƒ์‹œํ‚ค๊ณ , ์‚ฌ์šฉ์ž ๊ฒฝํ—˜์„ ๊ทน๋Œ€ํ™”ํ•ฉ๋‹ˆ๋‹ค.

Joystick

  • ์„ค๋ช…: ๋ชจ๋ฐ”์ผ ํ™˜๊ฒฝ์—์„œ ์กฐ์ด์Šคํ‹ฑ ์ž…๋ ฅ์„ ์‹œ๋ฎฌ๋ ˆ์ด์…˜ํ•˜๋Š” ์ปดํฌ๋„ŒํŠธ์ž…๋‹ˆ๋‹ค. ์Šคํฌ๋กค ๋ธ”๋ก ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ชจ๋ฐ”์ผ ์žฅ์น˜์—์„œ ์œ„์น˜ ์ง€ํ„ฐ๋ฅผ ๋ฐฉ์ง€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • Props:

    Prop Name Type Required Description Default Value
    joystickStyle object (styles) Optional ์กฐ์ด์Šคํ‹ฑ ์ปจํ…Œ์ด๋„ˆ ์Šคํƒ€์ผ undefined
    joystickBallStyle object (styles) Optional ์กฐ์ด์Šคํ‹ฑ ๋ณผ ์Šคํƒ€์ผ undefined
  • ์‚ฌ์šฉ ์˜ˆ์ œ:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, Joystick } from '../../../src';
    
    export default function App() {
      const joystickStyle = {
        /* ์กฐ์ด์Šคํ‹ฑ ์ปจํ…Œ์ด๋„ˆ ์Šคํƒ€์ผ ์ •์˜ */
      };
      const joystickBallStyle = {
        /* ์กฐ์ด์Šคํ‹ฑ ๋ณผ ์Šคํƒ€์ผ ์ •์˜ */
      };
    
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'joystick', // ๋˜๋Š” 'keyboard', 'gamepad' ๋“ฑ
            scrollBlock: true, // ๋ชจ๋ฐ”์ผ ์žฅ์น˜์—์„œ ์œ„์น˜ ์ง€ํ„ฐ ๋ฐฉ์ง€
          }}
        >
          <Canvas>
            <Physics>
              <Joystick
                joystickStyle={joystickStyle}
                joystickBallStyle={joystickBallStyle}
              />
              {/* ๋‹ค๋ฅธ ์ปดํฌ๋„ŒํŠธ */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • ์ฃผ์š” ๊ธฐ๋Šฅ:

    • ์กฐ์ด์Šคํ‹ฑ ์ธํ„ฐํŽ˜์ด์Šค: ๋ชจ๋ฐ”์ผ ์žฅ์น˜์—์„œ ์ž์—ฐ์Šค๋Ÿฌ์šด ์กฐ์ด์Šคํ‹ฑ ์ž…๋ ฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
    • ์ปค์Šคํ„ฐ๋งˆ์ด์ง•: joystickStyle๊ณผ joystickBallStyle์„ ํ†ตํ•ด ์™ธ๊ด€์„ ์ž์œ ๋กญ๊ฒŒ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • ๋ฐ˜์‘ํ˜• ์ธํ„ฐ๋ž™์…˜: ํ„ฐ์น˜ ์ด๋ฒคํŠธ์— ๋ฐ˜์‘ํ•˜์—ฌ ์บ๋ฆญํ„ฐ ์›€์ง์ž„์„ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค.

KeyBoardTooltip

  • ์„ค๋ช…: ํ‚ค๋ณด๋“œ ์ปจํŠธ๋กค๋Ÿฌ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์‹œ๊ฐ์ ์œผ๋กœ ํ‘œํ˜„ํ•˜๋Š” ์ปดํฌ๋„ŒํŠธ๋กœ, ๊ฐ ํ‚ค์˜ ๋™์ž‘์„ ์‹œ๊ฐ์ ์œผ๋กœ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.

  • ์ฃผ์š” ๊ธฐ๋Šฅ:

    • ํ‚ค๋ณด๋“œ ํ‚ค ์‹œ๊ฐํ™”: ๋ชจ๋“  ํ‚ค๋ณด๋“œ ํ‚ค๋ฅผ ๋ฐฐ์—ด ํ˜•์‹์œผ๋กœ ์‹œ๊ฐํ™”ํ•ฉ๋‹ˆ๋‹ค.
    • ์ƒํƒœ ์• ๋‹ˆ๋ฉ”์ด์…˜: ํ˜„์žฌ ํ™œ์„ฑํ™”๋œ ํ‚ค์™€ ๊ด€๋ จ ๋™์ž‘์„ ๋‹ค๋ฅด๊ฒŒ ํ‘œ์‹œํ•˜์—ฌ ์‚ฌ์šฉ์ž ํ”ผ๋“œ๋ฐฑ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
    • ์ปค์Šคํ„ฐ๋งˆ์ด์ง•: ํ‚ค ์บก์˜ ์™ธ๊ด€์„ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ๋Š” ๋‹ค์–‘ํ•œ ์Šคํƒ€์ผ ์†์„ฑ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
  • ์‚ฌ์šฉ ์˜ˆ์ œ:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, KeyBoardToolTip } from '../../../src';
    
    export default function App() {
      const keyBoardToolTipInnerStyle = {
        /* ๋‚ด๋ถ€ ํˆดํŒ ์Šคํƒ€์ผ ์ •์˜ */
      };
      const selectedKeyCapStyle = {
        /* ์„ ํƒ๋œ ํ‚ค ์Šคํƒ€์ผ ์ •์˜ */
      };
      const notSelectedkeyCapStyle = {
        /* ์„ ํƒ๋˜์ง€ ์•Š์€ ํ‚ค ์Šคํƒ€์ผ ์ •์˜ */
      };
      const keyCapStyle = {
        /* ํ‚ค ์บก ๊ธฐ๋ณธ ์Šคํƒ€์ผ ์ •์˜ */
      };
    
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'keyboard', // ์ปจํŠธ๋กค๋Ÿฌ ๋ชจ๋“œ๋ฅผ 'keyboard'๋กœ ์„ค์ •
          }}
        >
          <Canvas>
            <Physics>
              <KeyBoardToolTip
                keyBoardToolTipInnerStyle={keyBoardToolTipInnerStyle}
                selectedKeyCapStyle={selectedKeyCapStyle}
                notSelectedkeyCapStyle={notSelectedkeyCapStyle}
                keyCapStyle={keyCapStyle}
              />
              {/* ๋‹ค๋ฅธ ์ปดํฌ๋„ŒํŠธ */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }

MiniMap

  • ์„ค๋ช…: ์‚ฌ์šฉ์ž์˜ ์œ„์น˜์™€ ์ฃผ๋ณ€ ํ™˜๊ฒฝ์„ 3D ์„ธ๊ณ„ ๋‚ด์— ์ž‘์€ ์ง€๋„ ํ˜•ํƒœ๋กœ ํ‘œ์‹œํ•˜๋Š” ์ปดํฌ๋„ŒํŠธ์ž…๋‹ˆ๋‹ค.

  • Props:

    Prop Name Type Required Description Default Value
    minimapStyle object (styles) Optional ๋ฏธ๋‹ˆ๋งต์˜ ์ „์ฒด ์Šคํƒ€์ผ undefined
    innerStyle object (styles) Optional ๋ฏธ๋‹ˆ๋งต ๋‚ด๋ถ€ ์ปจํ…Œ์ด๋„ˆ ์Šคํƒ€์ผ undefined
    textStyle object (styles) Optional ๋ฏธ๋‹ˆ๋งต ๋‚ด ํ…์ŠคํŠธ ์Šคํƒ€์ผ undefined
    objectStyle object (styles) Optional ๋ฏธ๋‹ˆ๋งต ๋‚ด ๊ฐ์ฒด ์Šคํƒ€์ผ undefined
    avatarStyle object (styles) Optional ๋ฏธ๋‹ˆ๋งต ๋‚ด ์•„๋ฐ”ํƒ€ ์Šคํƒ€์ผ undefined
    scaleStyle object (styles) Optional ๋ฏธ๋‹ˆ๋งต์˜ ์Šค์ผ€์ผ ์ปจํŠธ๋กค ์Šคํƒ€์ผ undefined
    directionStyle object (styles) Optional ๋ฏธ๋‹ˆ๋งต ๋‚ด ๋ฐฉํ–ฅ ํ‘œ์‹œ ์Šคํƒ€์ผ undefined
    plusMinusStyle object (styles) Optional ๋ฏธ๋‹ˆ๋งต์˜ ํ”Œ๋Ÿฌ์Šค/๋งˆ์ด๋„ˆ์Šค ์ปจํŠธ๋กค ์Šคํƒ€์ผ undefined
  • ์‚ฌ์šฉ ์˜ˆ์ œ:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, MiniMap } from '../../../src';
    
    export default function App() {
      const minimapStyle = {
        /* ๋ฏธ๋‹ˆ๋งต ์Šคํƒ€์ผ ์ •์˜ */
      };
      const innerStyle = {
        /* ๋‚ด๋ถ€ ์Šคํƒ€์ผ ์ •์˜ */
      };
      // ๊ธฐํƒ€ ์Šคํƒ€์ผ ์†์„ฑ ์ •์˜
    
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'keyboard',
          }}
        >
          <Canvas>
            <Physics>
              <MiniMap
                minimapStyle={minimapStyle}
                innerStyle={innerStyle}
                // ๊ธฐํƒ€ ์Šคํƒ€์ผ ์†์„ฑ ์ „๋‹ฌ
              />
              {/* ๋‹ค๋ฅธ ์ปดํฌ๋„ŒํŠธ */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • ์ฃผ์š” ๊ธฐ๋Šฅ:

    • ๋™์  ์Šค์ผ€์ผ๋ง: ์‚ฌ์šฉ์ž๊ฐ€ ๋ฏธ๋‹ˆ๋งต์˜ ํฌ๊ธฐ๋ฅผ ๋™์ ์œผ๋กœ ์กฐ์ ˆํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • ๋ฐฉํ–ฅ ํ‘œ์‹œ๊ธฐ: ๋™, ์„œ, ๋‚จ, ๋ถ ๋ฐฉํ–ฅ์„ ์‹œ๊ฐ์ ์œผ๋กœ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
    • ์ปค์Šคํ„ฐ๋งˆ์ด์ง•: ๋ฏธ๋‹ˆ๋งต ๋ฐ ๋‚ด๋ถ€ ์š”์†Œ๋“ค์˜ ์™ธ๊ด€์„ ๋‹ค์–‘ํ•œ ์Šคํƒ€์ผ ์†์„ฑ์„ ํ†ตํ•ด ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • ๋งˆ์šฐ์Šค ํœ  ์ง€์›: ๋งˆ์šฐ์Šค ํœ ์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฏธ๋‹ˆ๋งต์˜ ์Šค์ผ€์ผ์„ ์กฐ์ ˆํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

GameBoy

  • ์„ค๋ช…: ๋ชจ๋ฐ”์ผ ํ™˜๊ฒฝ์„ ์œ„ํ•œ GameBoy ์Šคํƒ€์ผ์˜ ๋ฐฉํ–ฅ ๋ฒ„ํŠผ์„ ๋ชจ๋ฐฉํ•œ ์ปจํŠธ๋กค๋Ÿฌ ์ธํ„ฐํŽ˜์ด์Šค์ž…๋‹ˆ๋‹ค.

  • Props:

    Prop Name Type Required Description Default Value
    gamePadStyle object (styles) Optional GamePad ์ปจํ…Œ์ด๋„ˆ ์Šคํƒ€์ผ undefined
    gamePadButtonStyle object (styles) Optional ๊ฐœ๋ณ„ GamePad ๋ฒ„ํŠผ ์Šคํƒ€์ผ undefined
    label string Optional ๋ฒ„ํŠผ์— ๋Œ€ํ•œ ์ปค์Šคํ…€ ๋ ˆ์ด๋ธ” undefined
  • ์‚ฌ์šฉ ์˜ˆ์ œ:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, GameBoy } from '../../../src';
    
    export default function App() {
      const gamePadStyle = {
        /* GamePad ์ปจํ…Œ์ด๋„ˆ ์Šคํƒ€์ผ ์ •์˜ */
      };
      const gamePadButtonStyle = {
        /* GamePad ๋ฒ„ํŠผ ์Šคํƒ€์ผ ์ •์˜ */
      };
    
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'gameboy', // ์ปจํŠธ๋กค๋Ÿฌ ๋ชจ๋“œ๋ฅผ 'gameboy'๋กœ ์„ค์ •
          }}
        >
          <Canvas>
            <Physics>
              <GameBoy
                gamePadStyle={gamePadStyle}
                gamePadButtonStyle={gamePadButtonStyle}
              />
              {/* ๋‹ค๋ฅธ ์ปดํฌ๋„ŒํŠธ */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • ์ฃผ์š” ๊ธฐ๋Šฅ:

    • ๋ฐฉํ–ฅ ๋ฒ„ํŠผ: GameBoyDirections ๋ฐฐ์—ด์„ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ฐฉํ–ฅ ๋ฒ„ํŠผ์„ ๊ตฌํ˜„ํ•ฉ๋‹ˆ๋‹ค.
    • ์ปจํ…์ŠคํŠธ ์ธ์‹ ๋ Œ๋”๋ง: GaesupWorldContext์˜ mode.controller ๊ฐ’์— ๋”ฐ๋ผ ์ปดํฌ๋„ŒํŠธ๋ฅผ ๋ Œ๋”๋งํ•ฉ๋‹ˆ๋‹ค.
    • ์ปค์Šคํ„ฐ๋งˆ์ด์ง•: gamePadStyle๊ณผ gamePadButtonStyle์„ ํ†ตํ•ด ์™ธ๊ด€์„ ์ž์œ ๋กญ๊ฒŒ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

GamePad

  • ์„ค๋ช…: ๋‹ค์–‘ํ•œ ์ปจํŠธ๋กค๋Ÿฌ ๋ชจ๋“œ๋ฅผ ์ง€์›ํ•˜๋Š” ์ปค์Šคํ„ฐ๋งˆ์ด์ง• ๊ฐ€๋Šฅํ•œ ์ปจํŠธ๋กค๋Ÿฌ ์ธํ„ฐํŽ˜์ด์Šค์ž…๋‹ˆ๋‹ค. ์กฐ์ด์Šคํ‹ฑ, GameBoy ๋“ฑ ๋‹ค์–‘ํ•œ ์ž…๋ ฅ ์‹œ๋‚˜๋ฆฌ์˜ค์— ์œ ์—ฐํ•˜๊ฒŒ ๋Œ€์‘ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

  • Props:

    Prop Name Type Required Description Default Value
    gamePadStyle object (styles) Optional GamePad ์ปจํ…Œ์ด๋„ˆ ์Šคํƒ€์ผ undefined
    gamePadButtonStyle object (styles) Optional ๊ฐœ๋ณ„ GamePad ๋ฒ„ํŠผ ์Šคํƒ€์ผ undefined
    label string Optional ๋ฒ„ํŠผ์— ๋Œ€ํ•œ ์ปค์Šคํ…€ ๋ ˆ์ด๋ธ” undefined
  • ์‚ฌ์šฉ ์˜ˆ์ œ:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, GamePad } from '../../../src';
    
    export default function App() {
      const gamePadStyle = {
        /* GamePad ์ปจํ…Œ์ด๋„ˆ ์Šคํƒ€์ผ ์ •์˜ */
      };
      const gamePadButtonStyle = {
        /* GamePad ๋ฒ„ํŠผ ์Šคํƒ€์ผ ์ •์˜ */
      };
    
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'gamepad', // ๋˜๋Š” 'joystick', 'gameboy' ๋“ฑ
          }}
        >
          <Canvas>
            <Physics>
              <GamePad
                gamePadStyle={gamePadStyle}
                gamePadButtonStyle={gamePadButtonStyle}
              />
              {/* ๋‹ค๋ฅธ ์ปดํฌ๋„ŒํŠธ */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • ์ฃผ์š” ๊ธฐ๋Šฅ:

    • ๋™์  ๋ฒ„ํŠผ ๋ Œ๋”๋ง: GaesupWorldContext์˜ control ๊ฐ์ฒด๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ฒ„ํŠผ์„ ๋™์ ์œผ๋กœ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
    • ๋ฒ”์šฉ ์‚ฌ์šฉ: ์กฐ์ด์Šคํ‹ฑ, GameBoy ๋“ฑ ๋‹ค์–‘ํ•œ ์ปจํŠธ๋กค๋Ÿฌ ๋ชจ๋“œ๋ฅผ ์ง€์›ํ•˜์—ฌ ๋‹ค์–‘ํ•œ ์ž…๋ ฅ ์‹œ๋‚˜๋ฆฌ์˜ค์— ๋Œ€์‘ํ•ฉ๋‹ˆ๋‹ค.
    • ์ปค์Šคํ„ฐ๋งˆ์ด์ง•: gamePadStyle๊ณผ gamePadButtonStyle์„ ํ†ตํ•ด ์™ธ๊ด€์„ ์ž์œ ๋กญ๊ฒŒ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ZoomButton

  • ์„ค๋ช…: ์นด๋ฉ”๋ผ๋ฅผ ํŠน์ • ์œ„์น˜๋กœ ์ด๋™์‹œํ‚ค๊ณ  ์คŒ์„ ์ œ์–ดํ•˜๋Š” ๋ฒ„ํŠผ ์ปดํฌ๋„ŒํŠธ์ž…๋‹ˆ๋‹ค. ์ฃผ๋กœ ํŠน์ • ํƒ€๊ฒŸ์œผ๋กœ์˜ ์คŒ์ธ/์คŒ์•„์›ƒ์— ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

  • Props:

    Prop Name Type Required Description Default Value
    position THREE.Vector3 Required ์นด๋ฉ”๋ผ๊ฐ€ ์ด๋™ํ•  ๋ชฉํ‘œ ์œ„์น˜ None
    children React.ReactNode Optional ๋ฒ„ํŠผ ๋‚ด์— ๋ Œ๋”๋งํ•  React ๋…ธ๋“œ undefined
    target THREE.Vector3 Optional ์นด๋ฉ”๋ผ๊ฐ€ ๋ฐ”๋ผ๋ณผ ํƒ€๊ฒŸ ์œ„์น˜ undefined
    keepBlocking boolean Optional ์นด๋ฉ”๋ผ ์ด๋™ ์ค‘ ๋ธ”๋กœํ‚น์„ ์œ ์ง€ํ• ์ง€ ์—ฌ๋ถ€ undefined
    zoomButtonStyle object (styles) Optional ZoomButton ์ปดํฌ๋„ŒํŠธ์˜ ์Šคํƒ€์ผ undefined
  • ์‚ฌ์šฉ ์˜ˆ์ œ:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, ZoomButton } from '../../../src';
    import * as THREE from 'three';
    
    export default function App() {
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'keyboard',
          }}
        >
          <Canvas>
            <Physics>
              <ZoomButton
                position={new THREE.Vector3(0, 0, 5)}
                target={new THREE.Vector3(0, 0, 0)}
                zoomButtonStyle={{ backgroundColor: 'blue', color: 'white' }}
              >
                Zoom In
              </ZoomButton>
              {/* ๋‹ค๋ฅธ ์ปดํฌ๋„ŒํŠธ */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • ์ฃผ์š” ๊ธฐ๋Šฅ:

    • ์นด๋ฉ”๋ผ ์ด๋™: ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ์นด๋ฉ”๋ผ๋ฅผ ์ง€์ •๋œ ์œ„์น˜๋กœ ์ด๋™์‹œํ‚ต๋‹ˆ๋‹ค.
    • ์คŒ ์ œ์–ด: ์นด๋ฉ”๋ผ์˜ ์คŒ ๋ ˆ๋ฒจ์„ ์กฐ์ ˆํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • ์ปค์Šคํ„ฐ๋งˆ์ด์ง•: zoomButtonStyle์„ ํ†ตํ•ด ๋ฒ„ํŠผ์˜ ์™ธ๊ด€์„ ์ž์œ ๋กญ๊ฒŒ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

teleport

  • ์„ค๋ช…: ํด๋ฆญ ๊ฐ€๋Šฅํ•œ ํฌํƒˆ์„ ํ†ตํ•ด ์‚ฌ์šฉ์ž๋ฅผ ์ง€์ •๋œ ์œ„์น˜๋กœ ํ…”๋ ˆํฌํŠธํ•  ์ˆ˜ ์žˆ๋Š” ์ปดํฌ๋„ŒํŠธ์ž…๋‹ˆ๋‹ค. ์ธํ„ฐ๋ž™ํ‹ฐ๋ธŒํ•œ ํ…”๋ ˆํฌํ…Œ์ด์…˜ ํฌ์ธํŠธ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

  • Props:

    Prop Name Type Required Description Default Value
    text string Optional ํฌํƒˆ์— ํ‘œ์‹œํ•  ํ…์ŠคํŠธ undefined
    position THREE.Vector3 Required ํ…”๋ ˆํฌํŠธํ•  ๋ชฉํ‘œ ์œ„์น˜ None
    teleportStyle CSSProperties Optional ํฌํƒˆ์˜ ์™ธ๊ด€์„ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•˜๊ธฐ ์œ„ํ•œ CSS ์Šคํƒ€์ผ undefined
  • ์‚ฌ์šฉ ์˜ˆ์ œ:

    import React from 'react';
    import { Canvas } from '@react-three/fiber';
    import { Physics } from '@react-three/rapier';
    import { GaesupWorld, teleport } from '../../../src';
    import * as THREE from 'three';
    
    export default function App() {
      return (
        <GaesupWorld
          url={{
            characterUrl: 'https://your-s3-bucket/gaesupyee.glb',
          }}
          mode={{
            controller: 'keyboard',
          }}
        >
          <Canvas>
            <Physics>
              <teleport
                text="Teleport"
                position={new THREE.Vector3(10, 0, 5)}
                teleportStyle={{ backgroundColor: "blue", color: "white" }}
              />
              {/* ๋‹ค๋ฅธ ์ปดํฌ๋„ŒํŠธ */}
            </Physics>
          </Canvas>
        </GaesupWorld>
      );
    }
  • ์ฃผ์š” ๊ธฐ๋Šฅ:

    • ํ…”๋ ˆํฌํŠธ ๊ธฐ๋Šฅ: ๋ฒ„ํŠผ ํด๋ฆญ ์‹œ ์นด๋ฉ”๋ผ์™€ ์บ๋ฆญํ„ฐ๋ฅผ ์ง€์ •๋œ ์œ„์น˜๋กœ ์ด๋™์‹œํ‚ต๋‹ˆ๋‹ค.
    • ์ปค์Šคํ„ฐ๋งˆ์ด์ง•: teleportStyle์„ ํ†ตํ•ด ํฌํƒˆ์˜ ์™ธ๊ด€์„ ์ž์œ ๋กญ๊ฒŒ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
    • ํ…์ŠคํŠธ ํ‘œ์‹œ: ํฌํƒˆ์— ํ‘œ์‹œํ•  ํ…์ŠคํŠธ๋ฅผ ํ†ตํ•ด ์‚ฌ์šฉ์ž์—๊ฒŒ ๋ช…ํ™•ํ•œ ์•ˆ๋‚ด๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

๊ธฐ์—ฌ ๋ฐฉ๋ฒ•

Gaesup World์— ๊ธฐ์—ฌํ•˜๊ณ  ์‹ถ์œผ์‹ ๊ฐ€์š”? ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ๋”ฐ๋ผ์ฃผ์„ธ์š”:

  1. ํ”„๋กœ์ ํŠธ ํฌํฌ(Fork): GitHub์—์„œ ์ด ์ €์žฅ์†Œ๋ฅผ ํฌํฌํ•˜์„ธ์š”.

  2. ๊ฐœ๋ฐœ ๋ธŒ๋žœ์น˜๋กœ ์ „ํ™˜: dev ๋ธŒ๋žœ์น˜๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

    git checkout dev
  3. ๋ณ€๊ฒฝ ์‚ฌํ•ญ ์ปค๋ฐ‹: ๋ณ€๊ฒฝํ•œ ๋‚ด์šฉ์„ ์ปค๋ฐ‹ํ•ฉ๋‹ˆ๋‹ค.

    git commit -m 'Add some AmazingFeature'
  4. ๋ธŒ๋žœ์น˜์— ํ‘ธ์‹œ: ๋ณ€๊ฒฝํ•œ ๋ธŒ๋žœ์น˜๋ฅผ ์›๊ฒฉ ์ €์žฅ์†Œ์— ํ‘ธ์‹œํ•ฉ๋‹ˆ๋‹ค.

    git push origin dev
  5. ํ’€ ๋ฆฌํ€˜์ŠคํŠธ ์ƒ์„ฑ: GitHub์—์„œ ํ’€ ๋ฆฌํ€˜์ŠคํŠธ๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์ œ์ถœํ•ฉ๋‹ˆ๋‹ค.


๋ผ์ด์„ ์Šค

์ด ํ”„๋กœ์ ํŠธ๋Š” MIT ๋ผ์ด์„ ์Šค ํ•˜์— ๋ฐฐํฌ๋ฉ๋‹ˆ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ LICENSE๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”.


์ถ”๊ฐ€ ์ •๋ณด

Gaesup World๋Š” ์ง€์†์ ์œผ๋กœ ์—…๋ฐ์ดํŠธ๋˜๊ณ  ์žˆ์œผ๋ฉฐ, ์‚ฌ์šฉ์ž ํ”ผ๋“œ๋ฐฑ์„ ๋ฐ”ํƒ•์œผ๋กœ ๊ธฐ๋Šฅ์ด ๊ฐœ์„ ๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋” ์ž์„ธํ•œ ์ •๋ณด๋‚˜ ๋„์›€์ด ํ•„์š”ํ•˜์‹œ๋‹ค๋ฉด GitHub ์ด์Šˆ ํŠธ๋ž˜์ปค๋ฅผ ํ†ตํ•ด ๋ฌธ์˜ํ•ด ์ฃผ์„ธ์š”.


Gaesup World์™€ ํ•จ๊ป˜ ๋ชฐ์ž…๊ฐ ์žˆ๋Š” ์›น 3D ํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•ด ๋ณด์„ธ์š”!

About

โœจWeb 3D Character Controller and World Platform Library๐Ÿ”ฅ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published