
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Test whether a point is in an observer's field-of-view.
Given the location, heading, and field-of-view (as an angle) of an observer's eye, determine whether the target is visible (the blue triangle).
npm install fov-2d
var inFov = require('fov-2d')
var enemy = [0, 0]
var enemyFacing = [1, 0]
var enemyFov = Math.PI / 3 // 60 degrees
var player = [100, 0]
var crate = [0, 10]
var testPlayer = inFov(enemy, enemyFacing, enemyFov, player)
var testCrate = inFov(enemy, enemyFacing, enemyFov, crate)
console.log(testPlayer)
console.log(testCrate)
outputs
true
false
var fov = require('fov-2d')
eyePos
- origin of the eye [x, y]
eyeFacing
- the direction the eye is facing, given by a 2d vectoreyeFov
- the angle, in radians, of the eye's field-of-viewtargetPos
- origin of the target the eye is trying to test the visibility ofReturns true
if the target is within the eye's FOV, and false otherwise.
This module can be readily combined with modules like raycast-2d-tilemap to check for solid tiles in a tilemap to determine visibility.
FAQs
check whether a point is in an observer's field-of-view
We found that fov-2d demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.