-- Create a new ray info object.
-- This is just a utility alias with some extra type checking.

function FastCast.newBehavior(): FastCastBehavior
	-- raycastParams, maxDistance, acceleration, canPenetrateFunction, canHitFunction, cosmeticBulletTemplate, cosmeticBulletContainer, autoIgnoreBulletContainer
	return {
		RaycastParams = nil,
		Acceleration = Vector3.new(),
		TravelType = "Distance",
		MaxDistance = 1000,
		Lifetime = 5,
		CanPenetrateFunction = nil,
		CanHitFunction = nil,
		HighFidelityBehavior = FastCast.HighFidelityBehavior.Default,
		HighFidelitySegmentSize = 0.5,
		CosmeticBulletTemplate = nil,
		CosmeticBulletProvider = nil,
		CosmeticBulletContainer = nil,
		RaycastHitbox = nil,
		CurrentCFrame = CFrame.new(),
		ModifiedDirection = Vector3.new(),
		AutoIgnoreContainer = true,
		HitEventOnTermination = false,
		Hitscan = false
	}
end

local DEFAULT_DATA_PACKET = FastCast.newBehavior()
function FastCast:Fire(origin: Vector3, direction: Vector3, velocity: Vector3 | number, castDataPacket: FastCastBehavior?): ActiveCast
	if castDataPacket == nil then castDataPacket = DEFAULT_DATA_PACKET end
	
	local cast = ActiveCastStatic.new(self, origin, direction, velocity, castDataPacket)
	cast.RayInfo.WorldRoot = self.WorldRoot
	return cast
end
