-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V3.8.2 physics debug draw #16325
Merged
Merged
V3.8.2 physics debug draw #16325
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ics-debug-draw # Conflicts: # cocos/physics/physx/physx-adapter.ts # native/external-config.json
Interface Check Report! WARNING this pull request has changed these public interfaces:
@@ -47580,8 +47580,29 @@
*/
emitEvents(): void;
/**
* @en
+ * Get or set debug draw flags. Default is EPhysicsDrawFlags.NONE.
+ * Refer to EPhysicsDrawFlags.
+ * Note: Since physics debug draw uses Geometry-Renderer to do drawing,
+ * make sure Geometry-Renderer is not cropped in Project Setting.
+ * @zh
+ * 获取或设置调试绘制标志。默认为 EPhysicsDrawFlags.NONE。
+ * 参考 EPhysicsDrawFlags。
+ * 注意:因为物理调试绘制使用几何渲染器来绘制,请确保项目设置中几何渲染器没有被裁剪掉。
+ */
+ get debugDrawFlags(): number;
+ set debugDrawFlags(v: number);
+ /**
+ * @en
+ * Get or set constraint debug draw size. Default is 0.3.
+ * @zh
+ * 获取或设置约束的调试绘制尺寸。默认为 0.3。
+ */
+ get debugDrawConstraintSize(): number;
+ set debugDrawConstraintSize(v: number);
+ /**
+ * @en
* Collision detect all collider, and record all the detected results, through PhysicsSystem.Instance.RaycastResults access to the results.
* @zh
* 检测所有的碰撞盒,并记录所有被检测到的结果,通过 PhysicsSystem.instance.raycastResults 访问结果。
* @param worldRay @zh 世界空间下的一条射线 @en A ray in world space
@@ -49757,8 +49778,38 @@
* 默认分组。
*/
DEFAULT = 1
}
+ export enum EPhysicsDrawFlags {
+ /**
+ * @en
+ * Draw nothing.
+ * @zh
+ * 不绘制。
+ */
+ NONE = 0,
+ /**
+ * @en
+ * Draw wireframe
+ * @zh
+ * 绘制线框。
+ */
+ WIRE_FRAME = 1,
+ /**
+ * @en
+ * Draw Constraint.
+ * @zh
+ * 绘制约束
+ */
+ CONSTRAINT = 2,
+ /**
+ * @en
+ * Draw AABB.
+ * @zh
+ * 绘制包围盒。
+ */
+ AABB = 4
+ }
export { ITriggerEvent, TriggerEventType, TriggerCallback, IContactEquation, ICollisionEvent, CollisionEventType, CollisionCallback, CharacterTriggerEventType, CharacterCollisionEventType, CharacterControllerContact };
}
export namespace primitives {
/**
@@ -57624,8 +57675,9 @@
export import CapsuleCharacterController = physics.CapsuleCharacterController;
export import ERigidBodyType = physics.ERigidBodyType;
export import EAxisDirection = physics.EAxisDirection;
export import EColliderType = physics.EColliderType;
+ export import EPhysicsDrawFlags = physics.EPhysicsDrawFlags;
export namespace __private {
/**
* Engine classes with this kind of signature are integrated with editor extendability.
* @internal
@@ -66320,8 +66372,10 @@
maxDistance: number;
}
export interface _cocos_physics_spec_i_physics_world__IPhysicsWorld {
readonly impl: any;
+ debugDrawFlags: physics.EPhysicsDrawFlags;
+ debugDrawConstraintSize: number;
setGravity: (v: math.IVec3Like) => void;
setAllowSleep: (v: boolean) => void;
setDefaultMaterial: (v: physics.PhysicsMaterial) => void;
step(fixedTimeStep: number, timeSinceLastCalled?: number, maxSubSteps?: number): void;
|
SantyWang
reviewed
Sep 25, 2023
SantyWang
approved these changes
Sep 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Re: #https://github.com/cocos/3d-tasks/issues/17606
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: