JP2023042310A - Information processing device, program, and contact determination method - Google Patents
Information processing device, program, and contact determination method Download PDFInfo
- Publication number
- JP2023042310A JP2023042310A JP2021149546A JP2021149546A JP2023042310A JP 2023042310 A JP2023042310 A JP 2023042310A JP 2021149546 A JP2021149546 A JP 2021149546A JP 2021149546 A JP2021149546 A JP 2021149546A JP 2023042310 A JP2023042310 A JP 2023042310A
- Authority
- JP
- Japan
- Prior art keywords
- contact determination
- contact
- capsule
- objects
- shape
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
Description
本開示は、情報処理装置、プログラム、及び接触判定方法に関する。 The present disclosure relates to an information processing device, a program, and a contact determination method.
従来から、テレビゲームにおいて、オブジェクト空間内のオブジェクト同士の接触判定を行う技術が知られている。例えば、オブジェクトのエッジの位置を検出するための仮想体であって、ゲーム中において画面に表示されない球体、カプセル状、棒状などの形状の仮想体を用いて、仮想体とオブジェクトとの接触(衝突)位置を検出する技術が記載されている(例えば特許文献1参照)。 2. Description of the Related Art Conventionally, in video games, there has been known a technique for determining contact between objects in an object space. For example, a virtual body for detecting the position of the edge of an object, which is not displayed on the screen during the game and has a shape such as a sphere, a capsule, or a rod, is used to detect contact (collision) between the virtual body and the object. ) describes a technique for detecting a position (see, for example, Patent Document 1).
例えばオブジェクト空間内のオブジェクトの接触(衝突)判定は、接触判定を実装するためのコライダー(Collider)などの接触判定用のコンポーネントをオブジェクトに設定することで可能となる。接触判定用のコンポーネントは、接触判定のためのオブジェクトの接触判定形状を、球体、カプセル状、棒状などの形状として定義する。接触判定用のコンポーネントは画面に表示されないため、必ずしもオブジェクトのメッシュと同じ形状にしなくてもよい。 For example, contact (collision) determination of objects in the object space can be made by setting a component for contact determination such as a collider for implementing contact determination to the object. The contact determination component defines the contact determination shape of an object for contact determination as a sphere, capsule, rod, or the like. Since the contact detection component is not displayed on the screen, it does not necessarily have to have the same shape as the mesh of the object.
ところで、オブジェクトの接触判定形状をカプセル形状として定義した場合の処理負荷はオブジェクトの接触判定形状を球体形状として定義した場合よりも大きくなることが課題として知られている。なお、特許文献1は、オブジェクトの接触判定形状をカプセル形状として定義した場合の処理負荷が、オブジェクトの接触判定形状を球体形状として定義した場合よりも大きくなる、という課題を解決するものではない。 By the way, it is known that the processing load when the contact determination shape of the object is defined as a capsule shape is larger than that when the contact determination shape of the object is defined as a spherical shape. Note that Patent Document 1 does not solve the problem that the processing load when defining the contact determination shape of an object as a capsule shape is greater than when the contact determination shape of an object is defined as a spherical shape.
本開示は、オブジェクト同士の接触判定の処理負荷を軽減すること、を課題とする。 An object of the present disclosure is to reduce the processing load of contact determination between objects.
本開示によれば、オブジェクト空間内のオブジェクト同士の接触判定を行う情報処理装置であって、接触判定を行う前記オブジェクトの少なくとも一方が、カプセル形状として接触判定を行うオブジェクトである場合に、前記カプセル形状を構成する二つの半球の中心座標をつなぐ線分の長さを算出する算出部と、算出した前記線分の長さに基づき、前記カプセル形状として接触判定を行うオブジェクトの接触判定処理を、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替える接触判定部と、を有する情報処理装置が提供される。 According to the present disclosure, an information processing apparatus that performs contact determination between objects in an object space, and when at least one of the objects for which contact determination is performed is an object for which contact determination is performed as a capsule shape, the capsule A calculation unit that calculates the length of a line segment that connects the center coordinates of two hemispheres that form a shape, and a contact determination process for objects that perform contact determination as the capsule shape based on the calculated length of the line segment, An information processing apparatus having a contact determination unit that switches from contact determination processing for a capsule shape to contact determination processing for a spherical shape is provided.
本開示によれば、オブジェクト同士の接触判定の処理負荷を軽減できる。 According to the present disclosure, it is possible to reduce the processing load of contact determination between objects.
以下、本開示を実施するための形態について図面を参照して説明する。なお、本実施形態では、オブジェクト同士の接触判定と呼ぶが、オブジェクト同士の衝突判定又は当たり判定など、異なる呼び方であってもよい。 Hereinafter, embodiments for implementing the present disclosure will be described with reference to the drawings. In the present embodiment, the contact determination between objects is called, but a different name such as collision determination or hit determination between objects may be used.
[システム構成]
まず、一実施形態に係るオブジェクト同士の接触判定方法を実現する情報処理システムの一例として、ゲームシステムの例を説明する。なお、一実施形態に係るオブジェクト同士の接触判定方法を実現する情報処理システムは、ゲームシステム以外でもよく、例えば物理シミュレーションシステムであってもよい。
[System configuration]
First, an example of a game system will be described as an example of an information processing system that realizes a contact determination method between objects according to an embodiment. An information processing system that realizes the contact determination method between objects according to an embodiment may be other than a game system, and may be, for example, a physics simulation system.
図1は本実施形態に係るゲームシステムの一例の構成図である。本実施形態のゲームシステムは図1(A)に示す情報処理装置10、又は図1(B)に示す情報処理システムにより構成される。図1(A)に示す情報処理装置10は、ユーザが操作するコンピュータである。図1(A)の情報処理装置10は、ユーザからの操作を、タッチパネル、コントローラ、マウス、又はキーボード等で受け付けて、操作に応じた情報処理を実行し、実行結果を表示する。
FIG. 1 is a configuration diagram of an example of a game system according to this embodiment. The game system of this embodiment is configured by the
また、図1(B)のゲームシステムは、情報処理装置10とサーバ装置14とがネットワーク18を介して通信可能に接続された構成である。図1(B)の情報処理装置10は図1(A)と同様なコンピュータである。図1(B)のサーバ装置14も図1(A)と同様なコンピュータで実現できる。
The game system shown in FIG. 1B has a configuration in which the
サーバ装置14は情報処理装置10との間でデータを送受信することで、情報処理装置10が受け付けたユーザの操作に応じた情報処理を実行し、実行結果を情報処理装置10に提供する。情報処理装置10はサーバ装置14から提供された実行結果を表示する。
By transmitting and receiving data to and from the
サーバ装置14はクラウドコンピュータにより実現してもよい。なお、図1(B)に示したサーバ装置14の個数は、1つに限定されるものではなく、2つ以上で分散処理してもよい。サーバ装置14は情報処理装置10へのプログラム(アプリケーション)などのダウンロード処理、ユーザのログイン処理、又は各種データベースを管理する処理、などに利用してもよい。なお、図1のシステム構成は一例である。
The
[ハードウェア構成]
本実施形態に係る情報処理装置10は、例えば図2に示すように構成される。サーバ装置14の構成は情報処理装置10と同様であるため、説明を省略する。図2は本実施形態に係る情報処理装置のハードウェア構成の一例を示す図である。
[Hardware configuration]
The
図2の情報処理装置10は、例えばCPU(Central Processing Unit)100、記憶装置102、通信装置104、入力装置106、及び出力装置108を有する。CPU100はプログラムに従って情報処理装置10を制御する。記憶装置102は、例えばROM(Read Only Memory)やRAM(Random Access Memory)などのメモリ、HDD(Hard Disk Drive)やSSD(Solid State Drive)などのストレージである。記憶装置102はCPU100で実行するプログラム及びデータを記憶する。
The
通信装置104は、通信を制御するネットワーク回路などの通信デバイスである。入力装置106は、タッチパッド、コントローラ、マウス、キーボード、カメラ、マイクなどの入力デバイスである。また、出力装置108はディスプレイ、スピーカなどの出力デバイスである。タッチパネルは入力装置106の一例であるタッチパッドと出力装置108の一例であるディスプレイとを組み合わせることで実現される。図2のハードウェア構成は一例である。
The
[機能ブロック]
以下では、情報処理装置10がプレイヤなどのユーザから実行中のゲームに対する操作を受け付け、操作に応じたゲームの画像を生成して表示することで、ユーザにゲームをプレイさせる場合の機能構成例を説明する。図3の機能構成は一例であって、例えば図3に示した機能構成の少なくとも一部をサーバ装置14に設け、情報処理装置10とサーバ装置14とが連携して処理を行うようにしてもよい。
[Function block]
In the following, an example of a functional configuration in which the
図3は本実施形態に係る情報処理装置の機能構成の一例を示す図である。図3の情報処理装置10は、制御部200、操作受付部202、出力制御部204、通信部206、及び記憶部210を有する。
FIG. 3 is a diagram showing an example of the functional configuration of the information processing apparatus according to this embodiment. The
記憶部210は、ゲームプログラム212、オブジェクトDB214、閾値設定DB216、及び基準座標DB218を記憶する。記憶部210は記憶装置102で実現してもよいし、ネットワーク18等を介して接続された記憶装置により実現してもよい。
ゲームプログラム212は、CPU100が実行するゲーム処理のプログラムの一例である。オブジェクトDB214は、ゲームの画像に表示されるオブジェクトに関する情報を記憶している。ゲームの画像に表示されるオブジェクトは、プレイヤキャラクタのオブジェクト、敵キャラクタのオブジェクト、背景のオブジェクト、武器や盾などの装備品のオブジェクト、武器や兵器から発射される弾丸のオブジェクトなど、である。
The
閾値設定DB216はオブジェクト同士の接触判定に利用する後述の接触判定切替用閾値を記憶している。基準座標DB218はオブジェクト同士の接触判定に利用する後述の基準座標を記憶している。
The
本実施形態では、オブジェクト空間内に、オブジェクト同士の接触判定を行う複数のオブジェクトが配置され、オブジェクト空間内を所定の視点(仮想カメラ)から見た画像を生成してユーザにゲームを実行させる。オブジェクト空間とは、2次元または3次元座標系上にポリゴンモデル等のオブジェクトが存在する空間のことである。例えばポリゴンモデルは、2次元または3次元のコンピュータグラフィックスでオブジェクト空間内に配置される。 In this embodiment, a plurality of objects for determining contact between objects are arranged in the object space, an image of the object space viewed from a predetermined viewpoint (virtual camera) is generated, and the user is allowed to play the game. An object space is a space in which an object such as a polygon model exists on a two-dimensional or three-dimensional coordinate system. For example, polygonal models are placed in object space in two-dimensional or three-dimensional computer graphics.
制御部200は情報処理装置10の全体の制御を行う。情報処理装置10の全体の制御には、ユーザから実行中のゲームに対する操作を受け付け、操作に応じたゲームの画像を生成して表示する制御が含まれる。
The
制御部200は、CPU100がゲームプログラム212などのプログラムに記載された処理を実行することにより実現される。図3の制御部200は、ゲーム制御部230を有する構成である。ゲーム制御部230は、オブジェクト生成部240、画像生成部242、算出部244、接触判定部246、及び接触処理部248を有する構成である。
ゲーム制御部230はゲームに関する制御を行う。例えばゲーム制御部230はゲーム処理を実行し、実行中のゲーム処理に従ってゲームの画像を生成し、ゲームの画面として出力装置108に表示させる。
The
オブジェクト生成部240は、オブジェクト空間内に配置する複数のオブジェクトの例えばテクスチャをレンダリングし、ポリゴンモデルにテクスチャをマッピングして、オブジェクトを生成する。また、オブジェクト生成部240は生成したオブジェクトに、接触判定を実装するための接触判定用のコンポーネントを設定する。
The
接触判定用のコンポーネントは、接触判定のためのオブジェクトの接触判定形状を、球体、カプセル状、棒状など、様々な形状として定義できる。ここでは、オブジェクトの接触判定形状をカプセル形状又は球体形状として定義する場合の処理について説明する。 The contact determination component can define contact determination shapes of objects for contact determination as various shapes such as spheres, capsules, and rods. Here, a description will be given of the processing in the case where the object contact determination shape is defined as a capsule shape or a spherical shape.
画像生成部242は、オブジェクトDB214に記憶されているオブジェクトに関する情報、閾値設定DB216に記憶されている後述の接触判定切替用閾値、及び基準座標DB218に記憶されている後述の基準座標、などに従って、実行中のゲームの画像を生成する。画像生成部242は、接触判定を行う複数のオブジェクトがオブジェクト空間内に配置されたゲームの画像を生成する。
The
算出部244は、オブジェクト空間内に配置された複数のオブジェクト同士の接触判定を行うために必要な長さや距離を算出する。例えば算出部244は、接触判定形状がカプセル形状として設定されたオブジェクトの場合、後述するように、カプセル形状を構成する二つの半球の中心座標をつなぐ線分の長さを算出する。また、算出部244は、後述するように、オブジェクト空間内に設定した基準座標と、接触判定形状がカプセル形状として設定されたオブジェクトとの距離を算出する。
The
接触判定部246は、オブジェクト空間内に配置された複数のオブジェクト同士の接触判定を行う。例えば接触判定部246は、接触判定形状がカプセル形状として設定されたオブジェクトである場合、算出部244により算出されたカプセル形状を構成する二つの半球の中心座標をつなぐ線分の長さに基づき、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替える。
The
また、接触判定部246は、接触判定形状がカプセル形状として設定されたオブジェクトである場合、算出部244により算出されたカプセル形状を構成する二つの半球の中心座標をつなぐ線分の長さが閾値(接触判定切替用閾値)より小さければ、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替える。
In addition, when the contact determination shape is an object set as a capsule shape, the
閾値は、オブジェクト空間内に設定した基準座標と、接触判定を行うオブジェクトとの距離に応じて設定される。例えば設定値は、基準座標と、接触判定を行うオブジェクトとの距離が大きいほど大きく、距離が小さいほど小さく設定される。また、閾値は接触判定を行うオブジェクトのゲームにおける重要度(ユーザの注目度)などに基づき、設定されてもよい。その他、閾値は、オブジェクト空間内に設定した基準座標と接触判定を行うオブジェクトとの距離と、接触判定を行うオブジェクトの重要度と、の組み合わせに基づいて設定されてもよい。 The threshold is set according to the distance between the reference coordinates set in the object space and the object for contact determination. For example, the larger the distance between the reference coordinates and the object for which contact determination is to be performed, the larger the set value, and the smaller the distance, the smaller the set value is set. Also, the threshold value may be set based on the degree of importance in the game of the object for which contact determination is to be performed (the degree of attention of the user). Alternatively, the threshold may be set based on a combination of the distance between the reference coordinates set in the object space and the object for which contact determination is to be performed, and the importance of the object for which contact determination is to be performed.
接触処理部248は、オブジェクト空間内に配置されたオブジェクトであって、接触判定部246の接触判定により、接触したと判定されたオブジェクトに対して、接触処理を行う。例えば接触処理部248は、接触判定部246がオブジェクト空間内に配置された敵キャラクタのオブジェクトに弾丸のオブジェクトが接触したと判定した場合、その接触による敵キャラクタのオブジェクトへの影響を判断する。例えば弾丸のオブジェクトの接触による敵キャラクタのオブジェクトへの影響は、敵キャラクタのオブジェクトの描画を弾丸の当たった後の描画に変更する処理に利用される。
The
操作受付部202は入力装置106に対するユーザの各種操作を受け付ける。出力制御部204は制御部200の制御に従って各種画面を出力装置108に表示する。操作受付部202はCPU100がプログラムに従って入力装置106を制御することにより実現される。また、出力制御部204は、CPU100がプログラムに従って出力装置108を制御することにより実現される。入力装置106に対するユーザの各種操作とは、CPU100に処理を実行させるため、ユーザが操作受付部202を操る操作をいう。出力制御部204は、制御部200の制御に従い、各種画面の表示と音の出力とを行う。
An
通信部206は、ネットワーク18等を介して通信する。通信部206はCPU100がプログラムを実行し、プログラムに従って通信装置104を制御することにより実現される。
A
図4はオブジェクトDBの一例の構成図である。オブジェクトDB214は、ゲームの画像に表示されるオブジェクトに関する情報として、オブジェクトID、及び接触判定形状定義情報を対応付けて記憶している。オブジェクトIDは、ゲームの画像に表示されているオブジェクトを識別する情報の一例である。接触判定形状定義情報は、接触判定のためのオブジェクトの接触判定形状を定義する情報の一例である。図4のオブジェクトDB214では、接触判定のためのオブジェクトの接触判定形状の一例として、カプセル形状及び球体形状が定義されている例を示している。
FIG. 4 is a configuration diagram of an example of an object DB. The
図5は閾値設定DBの一例の構成図である。閾値設定DB216は、オブジェクト同士の接触判定に利用する情報として、接触判定切替用閾値を記憶している。図5は一つの接触判定切替用閾値を記憶する例を示したが、後述するように、条件と対応付けて複数の接触判定切替用閾値を動的に記憶していてもよい。
FIG. 5 is a configuration diagram of an example of a threshold setting DB. The
[接触判定形状が球体形状及びカプセル形状の場合の接触判定]
図6は接触判定形状が球体形状及びカプセル形状の場合の接触判定について説明するための一例の図である。図6(A)は接触判定形状が球体形状の場合の接触判定例を示している。図6(B)は接触判定形状が球体形状の場合の接触判定例を示している。
[Contact determination when the contact determination shape is a spherical shape and a capsule shape]
FIG. 6 is a diagram for explaining an example of contact determination when the contact determination shape is a spherical shape and a capsule shape. FIG. 6A shows an example of contact determination when the contact determination shape is spherical. FIG. 6B shows an example of contact determination when the contact determination shape is spherical.
図6(A)において、接触判定形状が球体形状のオブジェクト300(以下、単に球体形状のオブジェクトと呼ぶことがある)と、球体形状のオブジェクト300と比較して十分に小さいオブジェクト302との接触判定を行う場合は、矢印304に示す距離(オブジェクト300の中心とオブジェクト302との距離)がオブジェクト300の半径以下か否かにより、球体形状のオブジェクト300とオブジェクト302とが接触しているか否かを判定できる。
In FIG. 6A, contact determination between an
図6(B)において、接触判定形状がカプセル形状のオブジェクト310(以下、単にカプセル形状のオブジェクトと呼ぶことがある)と、カプセル形状のオブジェクト310と比較して十分に小さいオブジェクト312との接触判定を行う場合は、以下の第1から第4の判定が必要になる。
In FIG. 6B, contact determination between an
例えば第1の判定では、矢印320に示す距離(オブジェクト310を構成する上側の半球(上球)の中心座標314とオブジェクト312との距離)がオブジェクト310の上球の半径以下であるか否かを判定する。矢印320に示す距離がオブジェクト310の上球の半径以下であれば、カプセル形状のオブジェクト310とオブジェクト312とは接触していると判定できる。
For example, in the first determination, whether or not the distance indicated by arrow 320 (the distance between the center coordinates 314 of the upper hemisphere (upper sphere) forming
例えば第2の判定では、矢印322に示す距離(オブジェクト310を構成する下側の半球(下球)の中心座標316とオブジェクト312との距離)がオブジェクト310の下球の半径以下であるか否かを判定する。矢印322に示す距離がオブジェクト310の下球の半径以下であれば、カプセル形状のオブジェクト310とオブジェクト312とは接触していると判定できる。
For example, in the second determination, it is determined whether the distance indicated by the arrow 322 (the distance between the center coordinates 316 of the lower hemisphere (lower sphere) forming the
例えば第3の判定では、オブジェクト312からオブジェクト310の軸に垂直な線分を伸ばした場合に、軸と線分との交点が、矢印326に示すオブジェクト310の円柱部分に含まれるか否かを判定する。なお、オブジェクト310の軸は、上球の中心座標314と下球の中心座標316とを通る直線により表される。また、第4の判定では、矢印324に示す距離(オブジェクト312からオブジェクト310の軸に垂直な線分を伸ばした場合の距離)がオブジェクト310の半球の半径以下であるか否かを判定する。
For example, in the third determination, when a line segment perpendicular to the axis of the
第3の判定で、軸と線分との交点が、矢印326に示すオブジェクト310の円柱部分に含まれると判定し、且つ、第4の判定で、矢印324に示す距離がオブジェクト310の半球の半径以下であると判定すれば、カプセル形状のオブジェクト310とオブジェクト312とは接触していると判定できる。
A third determination determines that the intersection of the axis and the line segment is included in the cylindrical portion of the
第1から第4の判定の全てにおいてカプセル形状のオブジェクト310とオブジェクト312とが接触していると判定されなければ、カプセル形状のオブジェクト310とオブジェクト312とは接触していないと判定できる。
If it is determined that the capsule-shaped
図6に示すように、カプセル形状のオブジェクト310の接触判定の処理負荷(処理コスト)は、球体形状のオブジェクト300の接触判定の処理負荷よりも大きくなる。そこで、カプセル形状のオブジェクト310の接触判定の処理負荷を軽減する接触判定方法について検討した。
As shown in FIG. 6 , the processing load (processing cost) of contact determination for the capsule-shaped
図7はカプセル形状のオブジェクトの接触判定の処理負荷を軽減する接触判定方法について説明するための一例の図である。図7において、カプセル形状のオブジェクト330は図6(B)のカプセル形状のオブジェクト310と比べて、矢印342に示す円柱部分が短い(上球の中心座標334と下球の中心座標336とを繋ぐ線分が短い)。
FIG. 7 is a diagram illustrating an example of a contact determination method for reducing the processing load of contact determination of a capsule-shaped object. In FIG. 7, the capsule-shaped
図7のカプセル形状のオブジェクト330は矢印342に示す円柱部分が短く、例えば図6(A)に示した球体形状のオブジェクト300と近い形状となる。そこで、本実施形態では、カプセル形状のオブジェクト330の軸(半球と半球との間の円柱部分)が十分に短い場合に、カプセル形状のオブジェクト330の接触判定処理を、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替えることで、接触判定の簡略化による処理コストの軽減を実現して、接触判定を高速化する。
The capsule-shaped
[処理]
以下では、本実施形態に係るゲームシステムがユーザからゲームに対する操作を受け付けて、その操作に応じたゲームの画像を生成して出力装置108に表示(出力)する処理例を説明する。図8は本実施形態に係るゲームシステムの処理の一例のフローチャートである。
[process]
An example of processing in which the game system according to the present embodiment receives a game operation from a user, generates a game image according to the operation, and displays (outputs) the image on the
ステップS10において、情報処理装置10はゲームのプレイを開始する操作をユーザから受け付ける。情報処理装置10のゲーム制御部230は、ユーザから受け付けた操作に従って、ゲーム処理の実行を開始する。
In step S10, the
ステップS12において、ゲーム制御部230は生成するゲームの画像に必要なプレイヤキャラクタ、敵キャラクタなどのオブジェクトの生成をオブジェクト生成部240に要求する。オブジェクト生成部240は、オブジェクト空間内に配置する複数のオブジェクトを生成する。
In step S12, the
また、オブジェクト生成部240は生成したオブジェクトに、接触判定を実装するための接触判定用のコンポーネントを設定し、それぞれのオブジェクトの接触判定形状を定義する。画像生成部242は、接触判定を行う複数のオブジェクトがオブジェクト空間内に配置されたゲームの画像を生成する。画像生成部242は、時間経過に従い、オブジェクト空間内の複数のオブジェクトが移動するゲームの画像を生成する。
In addition, the
ステップS14において、ゲーム制御部230はオブジェクト空間内に配置された複数のオブジェクト同士の接触判定が必要か否かを判定する。オブジェクト空間内に配置された複数のオブジェクト同士の接触判定が必要か否かの判定は、ゲームの種類によって適宜設定されればよい。
In step S14, the
例えばプレイヤキャラクタが発射した弾丸のオブジェクトがオブジェクト空間内に存在する間だけ、弾丸のオブジェクトと、その他のオブジェクトとの接触判定を行うゲームであれば、オブジェクト空間内に弾丸のオブジェクトが存在するか否かにより、接触判定が必要か否かを判定できる。 For example, in the case of a game that determines contact between the bullet object and other objects only while the bullet object fired by the player character exists in the object space, whether or not the bullet object exists in the object space is determined. It can be determined whether contact determination is necessary or not.
また、所定時間ごとにオブジェクト空間内に存在するオブジェクト同士の接触判定を行うゲームであれば、所定時間を経過しているか否かにより、接触判定が必要か否かを判定できる。 Further, in the case of a game in which contact determination between objects existing in the object space is performed at predetermined time intervals, it is possible to determine whether or not contact determination is necessary based on whether or not the predetermined time has elapsed.
ゲーム制御部230はオブジェクト空間内に配置された複数のオブジェクト同士の接触判定が必要と判定すると、ステップS16の接触判定処理を行う。ゲーム制御部230はオブジェクト空間内に配置された複数のオブジェクト同士の接触判定が必要でないと判定すると、ステップS16の接触判定処理をスキップする。
When the
ステップS18において、ゲーム制御部230はゲーム終了か否かを判定する。ゲーム終了でなければ、ゲーム制御部230はステップS12に戻り、ステップS12以降に示したゲームの処理を継続する。なお、ゲーム終了であれば、ゲーム制御部230は図8のフローチャートの処理を終了する。
In step S18, the
ステップS16の接触判定処理は、例えば図9に示す手順で実行される。図9は本実施形態に係る接触判定処理の一例のフローチャートである。ゲーム制御部230の算出部244はステップS30において、例えば図4のオブジェクトDB214から接触判定処理が未処理のオブジェクトを一つ選択する。
The contact determination process in step S16 is executed, for example, according to the procedure shown in FIG. FIG. 9 is a flowchart of an example of contact determination processing according to this embodiment. In step S30, the
ステップS32において、算出部244はステップS30で選択したオブジェクトの接触判定形状の定義がカプセル形状であるか否かを判定する。カプセル形状であれば、算出部244はステップS34の処理に進み、ステップS30で選択したオブジェクトのカプセル形状を構成する二つの半球の中心座標をつなぐ線分の長さを算出する。
In step S32, the
ステップS34に続いてステップS36の処理に進み、接触判定部246はステップS34で算出した線分の長さが、図5の閾値設定DB216の接触判定切替用閾値より小さいか否かを判定する。ステップS34で算出した線分の長さが、図5の閾値設定DB216の接触判定切替用閾値より小さければ、ステップS38の処理に進み、接触判定部246はステップS30で選択したカプセル形状のオブジェクトの接触判定を、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替える。このように、接触判定部246はステップS30で選択したカプセル形状のオブジェクトの接触判定を、球体形状用の接触判定処理で行い、カプセル形状のオブジェクトの接触判定を簡略化する。
Proceeding to the process of step S36 following step S34, the
ステップS34で算出した線分の長さが、図5の閾値設定DB216の接触判定切替用閾値より小さくなければ、ステップS40の処理に進み、接触判定部246はステップS30で選択したカプセル形状のオブジェクトの接触判定を、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替えない。接触判定部246は、ステップS30で選択したカプセル形状のオブジェクトの接触判定を、カプセル形状用の接触判定処理で行う。
If the length of the line segment calculated in step S34 is not smaller than the contact determination switching threshold of the
なお、ステップS32においてカプセル形状でないと判定すると、接触判定部246はステップS30で選択したカプセル形状以外の形状のオブジェクトの接触判定を、そのオブジェクトの接触判定形状に応じて行う。
If it is determined in step S32 that the shape of the object is not the capsule shape, the
ステップS44において、接触処理部248は接触判定部246がオブジェクトの接触ありと判定した場合、ステップS46の処理に進み、接触ありと判定されたオブジェクトに対して、接触処理を行う。なお、接触処理部248は接触判定部246がオブジェクトの接触ありと判定しなかった場合、ステップS46の処理をスキップする。
In step S44, when the
ステップS48において、算出部244は図4のオブジェクトDB214に未処理のオブジェクトがあるか否かを判定する。なお、未処理のオブジェクトがあれば、算出部244はステップS30の処理に戻り、図9のフローチャートの処理を継続する。未処理のオブジェクトがなければ、ゲーム制御部230は図9に示した接触判定処理を終了する。
In step S48, the
図9に示した接触判定処理は、閾値設定DB216に設定されている閾値が一つの例である。閾値設定DB216に設定される閾値は、以下のように条件と対応付けて複数の閾値を動的に設けてもよい。
One example of the contact determination process illustrated in FIG. 9 is the threshold set in the
図10は本実施形態に係るゲームシステムの処理の一例の説明図である。図11はオブジェクトDBの一例の構成図である。図12は閾値設定DBの一例の構成図である。 FIG. 10 is an explanatory diagram of an example of processing of the game system according to this embodiment. FIG. 11 is a configuration diagram of an example of the object DB. FIG. 12 is a configuration diagram of an example of a threshold setting DB.
例えば図10では、仮想カメラやユーザキャラクタのオブジェクト1000の位置座標を基準座標(中心)としている。図10の例では、例えば基準座標を中心として、基準座標からの距離に応じた複数の接触判定切替用閾値が設定される。図10の例では、基準座標からの距離が小さいほど、接触判定切替用閾値が小さく、基準座標からの距離が大きいほど、接触判定切替用閾値が大きくなるように、閾値設定DB216に設定される。
For example, in FIG. 10, the position coordinates of the virtual camera and the
図10のカプセル形状のオブジェクト1002は、基準座標からの距離がA未満であるオブジェクトの例である。オブジェクト1004は、基準座標からの距離がA以上B未満であるオブジェクトの例である。オブジェクト1006は、基準座標からの距離がB以上の例である。基準座標とオブジェクト1002、1004、及び1006との距離は、基準座標DB218に記憶されている基準座標と、図11のオブジェクトDBの位置情報とから算出できる。
A capsule-shaped
オブジェクト1002は、基準座標からの距離が一番近いオブジェクトの例であり、接触判定切替用閾値を最も小さく設定することで、カプセル形状のオブジェクトの接触判定をカプセル形状用の接触判定処理で行いやすくしている。例えば基準座標からの距離がA未満であるカプセル形状のオブジェクトの接触判定切替用閾値を「0」に設定しておくことにより、基準座標からの距離がA未満であるカプセル形状のオブジェクト1002の接触判定は、必ずカプセル形状用の接触判定処理で行われる。したがって、基準座標からの距離がA未満であるカプセル形状のオブジェクト1002の接触判定処理はカプセル形状用の接触判定処理により正確に行われることになる。
An
オブジェクト1006は、基準座標からの距離が一番遠いオブジェクトの例であり、接触判定切替用閾値を最も大きく設定することで、カプセル形状のオブジェクトの接触判定を球体形状用の接触判定処理で行いやすくしている。例えば基準座標からの距離がB以上であるカプセル形状のオブジェクトの接触判定切替用閾値を「100」に設定しておくことにより、基準座標からの距離がB以上であるカプセル形状のオブジェクト1006の接触判定は、オブジェクト1006の円柱部分の長さが長くても、球体形状用の接触判定処理で行われやすくなる。したがって、基準座標からの距離がB以上であるカプセル形状のオブジェクト1006の接触判定処理は球体形状用の接触判定処理により簡易的に行われることになる。
The
オブジェクト1004は、基準座標からの距離がオブジェクト1002より遠く、オブジェクト1006より近いオブジェクトの例であり、接触判定切替用閾値を調整して設定することで、カプセル形状のオブジェクトの接触判定を球体形状用の接触判定処理で行いにくくしている。
An
例えば基準座標からの距離がA以上B未満であるカプセル形状のオブジェクトの接触判定切替用閾値を「50」に設定しておくことにより、基準座標からの距離がA以上B未満であるカプセル形状のオブジェクト1004の接触判定は、オブジェクト1004の円柱部分の長さが短いという条件を満たしたときに、球体形状用の接触判定処理で行われることになる。
For example, by setting the contact determination switching threshold for a capsule-shaped object whose distance from the reference coordinates is A or more and less than B to "50", the capsule-shaped object whose distance from the reference coordinates is A or more and less than B is set to "50". Contact determination of the
したがって、基準座標からの距離がA以上B未満であるカプセル形状のオブジェクト1006の接触判定処理は、オブジェクト1004の円柱部分の長さが短いという条件を満たしたときに、球体形状用の接触判定処理により簡易的に行われることになる。
Therefore, the contact determination processing for the capsule-shaped
図10に示した例では、基準座標から近いカプセル形状のオブジェクトであれば、正確なカプセル形状用の接触判定処理を行うことで不自然な挙動を減らしつつ、基準座標から遠いカプセル形状のオブジェクトであるほど、簡易化した球体形状用の接触判定処理を行うことで処理負荷を軽減して接触判定処理を高速化できる。 In the example shown in FIG. 10, if the capsule-shaped object is close to the reference coordinates, by performing accurate capsule-shaped contact determination processing, unnatural behavior is reduced, and if the capsule-shaped object is far from the reference coordinates, By performing the simplified contact determination process for the spherical shape, the processing load can be reduced and the contact determination process can be speeded up.
ステップS16の接触判定処理は、例えば図13に示す手順で実行される。図13は本実施形態に係る接触判定処理の一例のフローチャートである。ゲーム制御部230の算出部244はステップS100において、例えば図11のオブジェクトDB214から接触判定処理が未処理のオブジェクトを一つ選択する。
The contact determination process in step S16 is executed, for example, according to the procedure shown in FIG. FIG. 13 is a flowchart of an example of contact determination processing according to this embodiment. In step S100, the
ステップS102において、算出部244はステップS100で選択したオブジェクトの接触判定形状の定義がカプセル形状であるか否かを判定する。カプセル形状であれば算出部244はステップS104の処理に進み、ステップS100で選択したオブジェクトの位置情報と、基準座標DB218に記憶されている基準座標と、の距離を算出する。
In step S102, the
また、ステップS106において、算出部244はステップS104で算出した距離に基づき、図12の閾値設定DB216から接触判定切替用閾値を設定する。本実施形態によれば、算出部244はオブジェクトの位置情報と、基準座標DB218に記憶されている基準座標と、の距離に基づき、異なる接触判定切替用閾値を設定できる。ステップS108において、算出部244はステップS100で選択したオブジェクトのカプセル形状を構成する二つの半球の中心座標をつなぐ線分の長さを算出する。
Also, in step S106, the
ステップS110において、接触判定部246はステップS108で算出した線分の長さが、ステップS106で設定した接触判定切替用閾値より小さいか否かを判定する。ステップS108で算出した線分の長さが、ステップS106で設定した接触判定切替用閾値より小さければ、ステップS112の処理に進み、接触判定部246はステップS100で選択したカプセル形状のオブジェクトの接触判定を、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替える。このように、接触判定部246はステップS100で選択したカプセル形状のオブジェクトの接触判定を、球体形状用の接触判定処理で行い、カプセル形状のオブジェクトの接触判定を簡略化する。
In step S110, the
ステップS108で算出した線分の長さが、ステップS106で設定した接触判定切替用閾値より小さくなければ、ステップS114の処理に進む。ステップS114において接触判定部246は、ステップS100で選択したカプセル形状のオブジェクトの接触判定を、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替えない。接触判定部246は、ステップS100で選択したカプセル形状のオブジェクトの接触判定を、カプセル形状用の接触判定処理で行う。
If the length of the line segment calculated in step S108 is not smaller than the contact determination switching threshold set in step S106, the process proceeds to step S114. In step S114, the
なお、ステップS102においてカプセル形状でないと判定すると、接触判定部246はステップS100で選択したカプセル形状以外の形状のオブジェクトの接触判定を、そのオブジェクトの接触判定形状に応じて行う。
If it is determined in step S102 that the shape of the object is not the capsule shape, the
ステップS118において、接触処理部248は接触判定部246がオブジェクトの接触ありと判定した場合、ステップS120の処理に進む。接触処理部248は、接触ありと判定されたオブジェクトに対して、接触処理を行う。なお、接触処理部248は接触判定部246がオブジェクトの接触ありと判定しなかった場合、ステップS120の処理をスキップする。
In step S118, when the
ステップS122において、算出部244は図11のオブジェクトDB214に未処理のオブジェクトがあるか否かを判定する。なお、未処理のオブジェクトがあれば、算出部244はステップS100の処理に戻り、図13のフローチャートの処理を継続する。未処理のオブジェクトがなければ、ゲーム制御部230は図13に示した接触判定処理を終了する。
In step S122, the
図13に示した接触判定処理は、例えば閾値設定DB216に、条件の一例であるオブジェクトの重要度と対応付けて複数の閾値が動的に設定されていてもよい。例えば、オブジェクトの重要度は、レイドボスなどのゲームにおいて重要なオブジェクト、ユーザの視線を集めやすいオブジェクトなどに高く設定し、重要でないオブジェクト、ユーザの視線を集めにくいオブジェクトなどに低く設定してもよい。
In the contact determination process shown in FIG. 13, for example, a plurality of thresholds may be dynamically set in the
その他、上記した接触判定処理は、ズーム機能を有するゲームに適用できる。ズーム機能を有するゲームに適用する場合、上記した接触判定処理は、例えばズームアップ可能な倍率ごとに閾値設定DB216を設定して対応してもよい。
In addition, the contact determination process described above can be applied to a game having a zoom function. When applied to a game having a zoom function, the contact determination process described above may be handled by setting the threshold
このように、本実施形態では、接触判定を実装するための接触判定用のコンポーネントを変更せずに、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替えることで、少ない処理負荷で、オブジェクト空間内のオブジェクト同士の接触判定をLOD(Level of Detail)処理化できる。LOD処理により、本実施形態ではオブジェクト空間に配置された複数のオブジェクト同士の接触判定において、見た目を損なわずに接触判定の処理負荷を軽減し、高速化できる。 As described above, in the present embodiment, the processing load can be reduced by switching from the contact determination processing for the capsule shape to the contact determination processing for the spherical shape without changing the contact determination component for implementing the contact determination. , LOD (Level of Detail) processing can be used to determine contact between objects in the object space. With the LOD processing, in the present embodiment, it is possible to reduce the processing load of contact determination without impairing the appearance and speed up the contact determination between a plurality of objects arranged in the object space.
本実施形態は、例えばFPS(First-person shooter)ゲームやアクションゲームに適用可能である。また、本実施形態ではゲームの画像の例を説明したが、ソーシャルネットワークサービスの利用者のアバターやノンプレイヤキャラクタ(NPC)が交流する仮想空間内を所定の視点から見た画像において、利用者のアバターやNPCが移動する画面などにおける接触判定への適用も可能である。 This embodiment is applicable to, for example, FPS (First-person shooter) games and action games. In the present embodiment, an example of a game image has been described. It can also be applied to contact determination on screens where avatars and NPCs move.
本実施形態によれば、オブジェクト空間内を所定の視点から見た画像を生成してユーザにゲームを実行させる情報処理装置10において、不自然な接触判定を減らしつつ、オブジェクト同士の接触判定の処理負荷を軽減できる。
According to this embodiment, in the
開示した一実施形態の情報処理装置は例示であって制限的なものではないと考えられるべきである。上記の実施形態は添付の請求の範囲及びその主旨を逸脱することなく、様々な形態で変形及び改良が可能である。また、上記した複数の実施形態に記載された事項は矛盾しない範囲で他の構成も取り得ることができ、また、矛盾しない範囲で組み合わせることができる。 The information processing apparatus of the disclosed embodiment should be considered as an example and not as a limitation. The embodiments described above can be modified and improved in various ways without departing from the scope and spirit of the appended claims. In addition, the items described in the above-described multiple embodiments can be configured in other configurations within a consistent range, and can be combined within a consistent range.
10 情報処理装置
14 サーバ装置
18 ネットワーク
200 制御部
202 操作受付部
204 出力制御部
206 通信部
210 記憶部
212 ゲームプログラム
214 オブジェクトDB
216 閾値設定DB
218 基準座標DB
230 ゲーム制御部
240 オブジェクト生成部
242 画像生成部
244 算出部
246 接触判定部
248 接触処理部
10
216 threshold setting DB
218 reference coordinate DB
230
Claims (6)
接触判定を行う前記オブジェクトの少なくとも一方が、カプセル形状として接触判定を行うオブジェクトである場合に、前記カプセル形状を構成する二つの半球の中心座標をつなぐ線分の長さを算出する算出部と、
算出した前記線分の長さに基づき、前記カプセル形状として接触判定を行うオブジェクトの接触判定処理を、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替える接触判定部と、
を有する情報処理装置。 An information processing device that determines contact between objects in an object space,
when at least one of the objects for which contact determination is performed is an object for which contact determination is performed as a capsule shape, a calculation unit that calculates the length of a line segment connecting the center coordinates of two hemispheres that form the capsule shape;
a contact determination unit that switches, based on the calculated length of the line segment, contact determination processing of an object for which contact determination is performed as the capsule shape from contact determination processing for the capsule shape to contact determination processing for the spherical shape;
Information processing device having
前記接触判定部は、前記カプセル形状として接触判定を行うオブジェクトの接触判定処理を、算出した前記線分の長さが、設定した前記閾値より小さければ、前記カプセル形状用の接触判定処理から前記球体形状用の接触判定処理に切り替えること、
を特徴とする請求項1記載の情報処理装置。 a threshold value setting unit that sets a larger threshold value as the distance between the reference coordinates set in the object space and the object for which contact determination is performed as the capsule shape is larger, and a smaller threshold value as the distance is smaller,
If the calculated length of the line segment is smaller than the set threshold value, the contact determination unit performs the contact determination processing of the object for which the contact determination is performed as the capsule shape. switching to contact determination processing for shapes;
2. The information processing apparatus according to claim 1, characterized by:
を特徴とする請求項2記載の情報処理装置。 The threshold setting unit sets a larger threshold as the importance of the object for contact determination as the capsule shape is lower, and a smaller threshold as the importance is higher;
3. The information processing apparatus according to claim 2, characterized by:
を特徴とする請求項2又は3記載の情報処理装置。 4. An information processing apparatus according to claim 2, wherein said reference coordinates are position coordinates of a virtual camera set in said object space or position coordinates of a player character.
接触判定を行う前記オブジェクトの少なくとも一方が、カプセル形状として接触判定を行うオブジェクトである場合に、前記カプセル形状を構成する二つの半球の中心座標をつなぐ線分の長さを算出する算出部、
算出した前記線分の長さに基づき、前記カプセル形状として接触判定を行うオブジェクトの接触判定処理を、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替える接触判定部、
として機能させるためのプログラム。 An information processing device that determines contact between objects in the object space,
a calculation unit that calculates the length of a line segment connecting the center coordinates of two hemispheres forming the capsule shape when at least one of the objects for which contact determination is performed is an object for which contact determination is performed as a capsule shape;
a contact determination unit that switches, based on the calculated length of the line segment, the contact determination processing of the object for which contact determination is performed as the capsule shape from the contact determination processing for the capsule shape to the contact determination processing for the spherical shape;
A program to function as
接触判定を行う前記オブジェクトの少なくとも一方が、カプセル形状として接触判定を行うオブジェクトである場合に、前記カプセル形状を構成する二つの半球の中心座標をつなぐ線分の長さを算出するステップと、
算出した前記線分の長さに基づき、前記カプセル形状として接触判定を行うオブジェクトの接触判定処理を、カプセル形状用の接触判定処理から球体形状用の接触判定処理に切り替えるステップと、
を情報処理装置が実行する接触判定方法。 A contact determination method for an information processing device for determining contact between objects in an object space, comprising:
when at least one of the objects for which contact determination is performed is an object for which contact determination is performed as a capsule shape, calculating the length of a line segment connecting the center coordinates of two hemispheres that form the capsule shape;
a step of switching the contact determination processing of the object for which contact determination is performed as the capsule shape from the contact determination processing for the capsule shape to the contact determination processing for the spherical shape based on the length of the calculated line segment;
A contact determination method executed by the information processing device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021149546A JP2023042310A (en) | 2021-09-14 | 2021-09-14 | Information processing device, program, and contact determination method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2021149546A JP2023042310A (en) | 2021-09-14 | 2021-09-14 | Information processing device, program, and contact determination method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2023042310A true JP2023042310A (en) | 2023-03-27 |
Family
ID=85717298
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2021149546A Pending JP2023042310A (en) | 2021-09-14 | 2021-09-14 | Information processing device, program, and contact determination method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2023042310A (en) |
-
2021
- 2021-09-14 JP JP2021149546A patent/JP2023042310A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8723867B2 (en) | Game apparatus, storage medium storing a game program, and game controlling method | |
JP4503073B2 (en) | Image resource loading system and image resource loading method for loading object for updating game screen | |
JP2022533321A (en) | VIRTUAL OBJECT CONTROL METHOD, APPARATUS, DEVICE AND COMPUTER PROGRAM | |
JP7387758B2 (en) | Interface display method, device, terminal, storage medium and computer program | |
CN110465087B (en) | Virtual article control method, device, terminal and storage medium | |
JPWO2005107903A1 (en) | Electronic game device, data processing method in electronic game device, program therefor, and storage medium | |
JP6106393B2 (en) | Program, game device, and server | |
JP5695621B2 (en) | Program, game device, and server | |
US20220023760A1 (en) | Virtual object selection method and apparatus, device, and storage medium | |
KR101826231B1 (en) | Game system and method for attacking coordinate | |
WO2023103615A1 (en) | Virtual object switching method and apparatus, device, medium and program product | |
JP2024001280A (en) | Method, device, terminal, and storage medium, for selecting virtual objects | |
JP2023174714A (en) | Program, image generation apparatus, and image generation method | |
US20130137513A1 (en) | Game machine, game system, game machine control method, and information storage medium | |
JP2023042310A (en) | Information processing device, program, and contact determination method | |
CN111558226A (en) | Method, device, equipment and storage medium for detecting abnormal operation behaviors | |
US20210183146A1 (en) | Content generation system and method | |
KR100510339B1 (en) | Method and system for renewing screen using mechanics information | |
JP6147779B2 (en) | Program, game device, and server | |
KR102656970B1 (en) | Virtual object selection methods and devices, devices, and storage media | |
KR102648210B1 (en) | Virtual object control method and device, terminal, and storage medium | |
JP7437440B2 (en) | Programs, electronic devices, methods, and systems | |
JP7170397B2 (en) | Program, image processing method, and image processing apparatus | |
JP2022188633A (en) | Information processing device, program, and game image generation method | |
JP2022175027A (en) | Information processing device, program, and game image generation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20231010 |