OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::P2Collision Class Reference

2 つの物体 A, B 間の接触に関する情報 More...

#include <P2Collision.hpp>

Public Member Functions

constexpr Vec2 normal () const noexcept
 物体 A から物体 B への接触の方向ベクトル返します。 More...
 
std::array< P2Contact, 2 >::const_iterator begin () const noexcept
 発生した衝突の先頭イテレータを返します。 More...
 
std::array< P2Contact, 2 >::const_iterator end () const noexcept
 発生した衝突の終端イテレータを返します。 More...
 
constexpr size_t num_contacts () const noexcept
 発生した衝突の数(最大 2)を返します。 More...
 
const P2Contactcontact (size_t index) const noexcept
 発生した衝突の情報を返します。 More...
 
constexpr bool hasContacts () const noexcept
 衝突が発生しているかを返します。 More...
 

Detailed Description

2 つの物体 A, B 間の接触に関する情報

Remarks
最大 2 つの P2Contact を持ちます。

Member Function Documentation

◆ begin()

std::array<P2Contact, 2>::const_iterator s3d::P2Collision::begin ( ) const
noexcept

発生した衝突の先頭イテレータを返します。

Returns
発生した衝突の先頭イテレータ

◆ contact()

const P2Contact& s3d::P2Collision::contact ( size_t  index) const
noexcept

発生した衝突の情報を返します。

Parameters
index衝突のインデックス
Remarks
index は num_contacts() 未満である必要があります。
Returns
発生した衝突の情報

◆ end()

std::array<P2Contact, 2>::const_iterator s3d::P2Collision::end ( ) const
noexcept

発生した衝突の終端イテレータを返します。

Returns
発生した衝突の終端イテレータ

◆ hasContacts()

constexpr bool s3d::P2Collision::hasContacts ( ) const
constexprnoexcept

衝突が発生しているかを返します。

Remarks
0 < num_contacts() を返します。
Returns
衝突が発生している場合 true, それ以外の場合は false

◆ normal()

constexpr Vec2 s3d::P2Collision::normal ( ) const
constexprnoexcept

物体 A から物体 B への接触の方向ベクトル返します。

Returns
物体 A から物体 B への接触の方向ベクトル

◆ num_contacts()

constexpr size_t s3d::P2Collision::num_contacts ( ) const
constexprnoexcept

発生した衝突の数(最大 2)を返します。

Returns
発生した衝突の数

The documentation for this class was generated from the following file: