foxhoundsk
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 虛擬實境 (Virtual Reality) 學習虛擬實境遊戲設計到最近差不多也有兩個多月了,在這兩個月中學到了不少東西,其中有了解遊戲是透過轉場來切換使用者看到的畫面(不只虛擬實境,一般遊戲也是差不多的概念)、每個場景(scene)可以使用 handler 來管控該場景發生的事件(例如:鍵盤或滑鼠的哪個按鈕被按下等等),除了每個場景可以有各別 handler 之外,還可以有個主要的 handler 來管控整個遊戲的事件,這個 handler 管理的事件是橫跨所有場景的,而它負責管理的事件可能是計時器(timer)、網路封包(socket)等等,從其中我們不難發現這些事件是不能因為切換場景就不理會他們,譬如說我們設計一個會一直跟伺服器通訊(伺服器需要監控同時上線人數)的遊戲,那麼我們就不能因為只是在遊戲中做了打開背包等動作就停止與伺服器的通訊,這時候就是這個 handler 發揮功用的時候了。除了這些,我還學到了遊戲設計中會用到的資料結構,像是 NPC 就會有一些屬於他自己獨有的屬性(attribute),譬如說反應速度(AI 強弱)等等,這時候我們就要在繼承完最基本的角色(character,遊戲中人物最基本的單位,也就是說可能是 NPC 或是玩家)類別(class)後再手動新增剛剛提到的屬性(這邊就屬於 NPC 的 private attribute)。因為之前接觸 C 語言比較多,所以剛開始使用 class 的時候其實還挺陌生的,但做了幾個簡單範例後就差不多熟了,不過我相信應該還有不少不懂的細節,像是 protected。雖然現在對 class 算比以前多了解了一些,不過太少寫 C# 或 C++ 的話可能不久就忘到只知道它是個類似 C 語言的 struct 只是他的功能比 struct 強大的東西。以上差不多就是我這兩個多月有西收到的東西,其他有些像是可以動態生成物件的功能就沒有完全了解了,可能是剛接觸到的時候腦袋轉不過來,就迷失在其中了:cry:,還有印象的大概就是那些物件有點類似 thraed pool 的概念,也就是其實那些物件已經做好了必要的初始化,之後只要等 event 發生後再把他們秀出來就好,這麼做的原因是為了不要讓 event 發生時 CPU 的使用量突然飆高(配備比較差的電腦會因此卡頓一下),換句話說,這是一種犧牲資源(記憶體)來換取順暢的手法,說到這邊就想到瀏覽器也有使用類似的手法(概念僅與後者有關),我們知道瀏覽器可以同時開很多個分頁,但若要在多個分頁之間順暢切換(切到另個分頁可以馬上看到其 content)的話,就會跟設定有關了,這邊以 Firefox 為例(Chrome 貌似沒有這項設定),Firefox 設定中有個選項可以設定最大 process 數量,這設定其實指的就是同時可以管理的分頁數量的能力,如果設定到最大(目前最大為8個 process)的話,我們就同時可以在非常多個分頁之間快速的切換,而可想而知假如設定成1個 process 的話我們在切換到比較久沒有瀏覽的分頁時可能會發生需要些許等待的情況,為什麼會發生這情況呢?其實我沒有深入研究,但我推測這些需要等待的分頁所使用的記憶體應該是被釋放了(並非踢到 swap (有觀察過),也就是說,其實這些分頁是當下被重新載入了)。最後我想説,虛擬實境其實蠻好玩的,因為玩家在遊戲時可以整個人沈浸在虛擬世界中(~~廢話xd~~),但我主要的興趣不在這邊,所以可能就先學個皮毛:smile: 。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully